请教一个编程题?

来源:百度知道 编辑:UC知道 时间:2024/06/16 01:42:01
若数组A中有十个整数8,2,5,-3,7,-9,0,-4,10,15,请编程求出该组中的最大值和最小值?

#include <stdio.h>
void main()
{
int i,t=0,a[10]={8,2,5,-3,7,-9,0,-4,10,15};
for(i=0;i<10;i++)
if(a[i]>t)
t=a[i];
printf("The max number is %d",t);
}

以上全部程序 我运行了 没有错的 分数要给我哈