杭电acm2004哪错了wrong answer
#include<cstdio>intmain(){intscore;while(scanf("%d",&score)!=EOF){switch(score/10){ca...
#include<cstdio>
int main()
{
int score;
while(scanf("%d",&score)!=EOF)
{
switch(score/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;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:printf("E\n");break;
default:printf("Score is error!\n");
}
}
return 0;
} 展开
int main()
{
int score;
while(scanf("%d",&score)!=EOF)
{
switch(score/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;
case 5:
case 4:
case 3:
case 2:
case 1:
case 0:printf("E\n");break;
default:printf("Score is error!\n");
}
}
return 0;
} 展开
2个回答
展开全部
#include<stdio.h>main(){ int a; while(scanf("%d",&a)!=EOF) { if(a>100||a<0) printf("Score is error!\n"); else if(a>=90) printf("A\n"); else if(a>=80) printf("B\n"); else if(a>=70) printf("C\n"); else if(a>=60) printf("D\n"); else printf("E\n"); }}
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询