输入10个数,输出min,max,average,sum
#include<stdio.h>
int main()
{
int a[10],i,sum=0,max,min;
float average;
for(i=0;i<10;i++)
scanf("%d",&a[i]);
max=a[0];
min=a[0];
for(i=0;i<10;i++)
{
sum+=a[i];
if(max<a[i])
max=a[i];
if(min>a[i])
min=a[i];
}
average=sum/10.0;
printf("%d %d %.2f %d",max,min,average,sum);
return 0;
}