编写程序,从键盘输入某学生的三科成绩,求出总分和平均分,找出最高分和最低分。

如题所述

第1个回答  2012-03-21
#include <stdio.h>
main()
{ int score[3],max,min,sum=0,i;
float ave;
printf("input three scores of the student:");
for(i=0;i<3;i++)
scanf("%d",&score[i]);
max=min=score[0];
for(i=0;i<3;i++)
{ sum+=score[i];
if(max<score[i])
max=score[i];
if(min>score[i])
min=score[i];
}
ave=sum/3;
printf("the sum of scores is %d\n",sum);
printf("the average score is %f\n",ave);
printf("the highest score is %d\n",max);
printf("the smallest score is %d\n",min);
}本回答被提问者采纳
第2个回答  2012-03-20
用Execl 表格做很轻松!
相似回答