要求输入一批学生成绩,以-1作结束标志,统计0-60,60-69,70-79,80-89,90-99,100的人数,并且输出人数,顺便再求一下全班人平均成绩,求大佬帮忙,在线等,急
2 回答
墨色风雨
TA贡献1853条经验 获得超6个赞
#include
void main()
{
int score,i;
printf("Enter the Student's Score:\n");
scanf("%d",&score;);
i= score/10;
switch( i )
{
case 10:
case 9: printf("A\n"); break;
case 8: printf("B\n"); break;
case 7: printf("C\n"); break;
case 6: printf("D\n"); break;
default:printf("E\n");
}
}
void main()
{
int score,i;
printf("Enter the Student's Score:\n");
scanf("%d",&score;);
i= score/10;
switch( i )
{
case 10:
case 9: printf("A\n"); break;
case 8: printf("B\n"); break;
case 7: printf("C\n"); break;
case 6: printf("D\n"); break;
default:printf("E\n");
}
}
添加回答
举报
0/150
提交
取消