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