展开全部
#include
main()
{
int iNum;
sacnf("%d", &iNum);
switch (iNum / 10)
{
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");break;
}
}
if语句:
#include
#include
int main(int aragc, char *argv[])
{
int score;
int ret;
printf("please input score:\n");
while(1){
ret = scanf("%d", &score);
if (ret){
if (score >= 90){
printf("A\n");
}
else if (score >= 80)
printf("B\n");
else if (score >= 70)
printf("C\n");
else if (score >= 60)
printf