编写根据输入的学生成绩判断等级的程序,即从键盘上输入一个学生的百分制成绩赋值给变量c,按下列要求输出其等级。 c ≥90 等级为A 80 ≤c<90 等级为B 70 ≤c<80 等级为C 60 ≤c<70 等级为D c<60 等级为E
A.
#include void main( ) { int c,s; printf("input a score(0-100):"); scanf("%d",&c); s=c/10; switch(s) { case 10: case 9: printf("%d: A\n",score); break; case 8: printf("%d: B\n",score); break; case 7: printf("%d: C\n",score);break; case 6: printf("%d: D\n",score); break; case 5: case 4: case 3: case 2: case 1: case 0: printf("%d: E\n",s); break; default: printf("input error!\n"); } }