📄 指针比较数组大小.cpp
字号:
#include<iostream.h>
int fun1(int *p,int n);
void main()
{int i,number1,y=10;
cout<<"please input the number of a"<<endl;
int *p=new int[10];
for(i=0;i<y;i++)
cin>>p[i];
number1=fun1(p,y);
cout<<"so we can get the new number of a"<<endl<<"max="<<number1<<endl;
}
int fun1(int * p,int n)
{int i,max=0;
for(i=0;i<n;i++)
if(*(p+i)>max)
max=*(p+i);
return max;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -