题解 | #统计成绩#
统计成绩
http://www.nowcoder.com/practice/cad8d946adf64ab3b17a555d68dc0bba
#include<stdio.h> int main() { int a=0; float arr[100],min=100.0,max=0.0,sum=0.0; scanf("%d",&a); for(int i = 0;i<a;++i) { scanf("%f",&arr[i]); sum+=arr[i]; if(min>arr[i]) { min = arr[i]; }if(max<arr[i]) { max = arr[i]; } } printf("%.2f %.2f %.2f",max,min,sum/5); return 0; }