新人求解答
#include <stdio.h>int max (int a, int b)
{
int maxx;
if (a>b)
maxx=a;
else
maxx=b;
return maxx;
}
int main (void)
{
int e[10]={0};
int maxx=0;
int i;
printf ("请输入10个数:\n");
for (i=0;i<10;++i)
scanf("%d\n",&e[i]);
for (i=0;i<10;i++)
maxx= max (maxx,e[i]);
printf ( "maxx=%d\n",maxx);
}
10个数求最大值,为什么要输11个数程序才运行?