编程实现成绩转换:要求输入100分以上时,输出“输入错误”,我不知道该怎么编,这是我写的程序,应该如何改?
#include<stdio.h>void main()
{
int score,grade;
printf("please input a score:");
scanf("%d",&score);
grade=score/10;
switch(grade)
{
case 10:printf("优秀\n");break;
case 9:printf("优秀\n");break;
case 8:printf("良好\n");break;
case 7:printf("中\n");break;
case 6:printf("及格\n");break;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:printf("不及格\n");break;
default:printf("输入错误\n");break;
}
}