#include <stdio.h>
#include <stdlib.h>
int main()
{
float score,max=0,min=100,sum=0;
int i;
char* s[5]={"英语","高数","物理","思政","计算机"};
while(1)
{
max=0;min=100;sum=0;
for(i=0;i<5;i++)
{
printf("\n%s:",s[i]);
fflush(stdin);
scanf("%f",&score);
sum+=score;
if(score>max) max=score;
if(score<min) min=score;
}
printf("\n最高分:%.0f, 最低分:%.0f, 平均分:%f",max,min,sum/5.0);
printf("\n继续吗(Y/N)? ");
char c;
fflush(stdin);
scanf("%c",&c);
if(c=='y' || c=='Y')
{
continue;
}
else
{
printf("\n程序结束,再见!");
break;
}
}
return 0;
}
温馨提示:答案为网友推荐,仅供参考