这道题刷新了我对蓝桥杯的看法,原来也是有简单的题目的!!!
#include<stdio.h>
int main()
{
int i;
float p, max = -1, min = 1000;
float grades,av, sum = 0;
scanf("%f", &p);
for(i=0;i<p;i++)
{
scanf("%f", &grades);
if (grades < min)
min = grades;
if (grades > max)
max = grades;
sum += grades;
}
av = sum / p;
printf("%.0f\n%.0f\n%.2f", max, min,av);
return 0;
}