题解 | 统计成绩
统计成绩
http://www.nowcoder.com/practice/cad8d946adf64ab3b17a555d68dc0bba
int main()
{
int n = 0;
double m = 0.0;
double sum = 0.0;
double max = 0.0;
double min = 100.0;
scanf("%d",&n);
while(scanf("%lf",&m)!=EOF)
{
if(m>max)
{
max = m;
}
if(m<min)
{
min = m;
}
sum = sum + m;
}
printf("%.2lf %.2lf %.2lf",max,min,sum/n);
return 0;
}