题解 | #统计成绩#
统计成绩
https://www.nowcoder.com/practice/cad8d946adf64ab3b17a555d68dc0bba
#include <stdio.h> int main() { int a=0; scanf("%d",&a); float b; scanf("%f",&b); float max=b; float min=b; float sum=b; int i; for(i=0;i<a-1;i++) { float d=0.0f; scanf("%f",&d); if(d>max) max=d; if(d<min) min=d; sum+=d; } float ave=sum*1.0/a; printf("%.2f %.2f %.2f",max,min,ave); return 0; }