此程序调用 findmax( )函数,返回数组中的最大值。
include ﹤iostream﹥
using namespace std;
int findmax (int *a, int n)
{
int *p, *s;
for(p=a, s=a; p-a﹤n; p++)
if(*P﹤*s) *s=*p;
return(* s);
}
void main( )
{
int x[5]={12,2,8,47};
cout﹤﹤ findmax(x, 5)﹤﹤endl;
}
订单号:
遇到问题请联系在线客服
订单号:
遇到问题请联系在线客服