#include<stdio.h> //编程小白,写的不好望多指点 int main() { int n = 0; int i = 0; float max = 0; //最大值 float min = 0; //最小值 float sum = 0; //求n个数的和 scanf("%d",&n); float arr[100] = {0}; //存放n科成绩 for(i = 0;i<n;i++) scanf("%f",&arr[i]); max = arr[0]; min = arr[0]; for(i = 0;i<n;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; }