大家帮帮看看这个代码错在哪了
#include <stdio.h> int main(){int a[10],max,min,sum=0;
float b;
for(i=0;i<=9;i++)
scanf("%d",&a[i]);
for(i=0;i<=9;i++)
{ max=min=a[0];
if (max<a[i])
max=a[i];
if (min>a[i])
min=a[i];
sum=+a[i];}
b=sum/10;
printf("%d,%d,%f\n",max,min,b);
return 0;
}
C:\Users\lenovo\Desktop\自动化\1.c(1) : warning C4067: unexpected tokens following preprocessor directive - expected a newline
C:\Users\lenovo\Desktop\自动化\1.c(2) : error C2449: found '{' at file scope (missing function header?)
C:\Users\lenovo\Desktop\自动化\1.c(16) : error C2059: syntax error : '}'
执行 cl.exe 时出错.
1.obj - 1 error(s), 0 warning(s)