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