您的位置:首页 > 其它

编写一个函数 求出int数组中最大的数

2012-05-24 13:27 246 查看
#include "stdAfx.h"
#include "ctype.h"
#include "stdlib.h"
int main(void)
{
void sum_(int a[],int x);
int a[5]={4,7,1,8,9};
sum_(a,5);
system("pause");
return 0;
}
void sum_(int a[],int x)
{
int i,sum;
sum=a[0];
for(i=0;i<x;i++)
if(sum<a[i])
sum=a[i];
printf("%d\n",sum);
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  include system
相关文章推荐