#include
int main()
{
int s;
printf("请输入一个成绩:");
scanf("%d", &s);
if(s>100 || s < 0)
{
printf("输入了一个错误的成绩。\n");
return 1;
}
char ch;
switch(s/10)
{
case 10:
case 9: ch = 'A'; break;
case 8: ch = 'B'; break;
case 7: ch = 'C'; break;
case 6: ch = 'D'; break;
default:
ch = 'E'; break;
}
printf("您输入的成绩等级为:%c\n", ch);
return 0;
}
#include
void main()
{
int s;
pritf("Please input:");
scanf("%d",s);
switch(s)
{
case s>90:printf("A\n"); break;
case s>80:printf("B\n"); break;
case s>70:printf("C\n"); break;
case s>60:printf("D\n"); break;
defalut:printf("E\n");break
}
}