楼上的橘基没有100分啊;还是c++程序,我给你个c的。
加了个输入非圆或谨法判断。楼主给分吧。。。
//--------------------------------------------------------
#include
int main()
{
unsigned char Score,Pscore;
printf("Please Input Scroe:\n");
scanf("%d",&Score);
if(Score>100||Score<0)
{
printf("The Score you entered is Illegal.");
return;
}
printf("The Score you entered is %d.\n",Score);
Pscore=Score/10;
switch(Pscore)
{
case 10:
case 9: printf("Your Score Grade is A.\n");break;
case 8: printf("Your Score Grade is B.\n");break;
case 7: printf("Your Score Grade is C.\n");break;
case 6: printf("Your Score Grade is D.\n");break;
default: printf("Your Score Grade is E.\n");break;
}
}
//----------------------------------------------------
楼主啊,有啥不懂的团仔可以问我哈。。。
何必楼上那样如此复杂……弊枯
看我代码(C语言)
#include
void main()
{
int score,grade,temp;
printf("Input scroe:");
scanf("%d",&score);
if(score>100||score<0)
printf("error\n");
else
{
temp=score/10;
switch(temp)
{
case 10:
缓激 case 9:
grade='A';break;
case 8:
扰卜袜 grade='B';break;
case 7:
grade='C';break;
case 6:
grade='D';break;
default:
grade='E';break;
}
printf("grade:%c\n",grade);
}
getch();
}
#include
void main()
{ int a,b;
cout<<"输入睁模改分数"<
b=a/10;
switch(b)
{case 9:cout<<"A"<
}
}
以上编译运行通过!!