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