kk


私信TA

用户名:bujidao

访问量:2202

签 名:

等  级
排  名 3440
经  验 1850
参赛次数 1
文章发表 11
年  龄 0
在职情况 待业
学  校 学校
专  业

  自我简介:

解题思路:可以将s缩小十倍,然后用switch-case语句,注意加上\n,否则运行答案错误。

注意事项:

参考代码:

#include<stdio.h>
int main()
{
int s;
while(scanf("%d",&s)!=EOF)
{
s=s/10;
switch(s)
{
case 1:
case 2:
case 3:
case 4:
case 5:printf("E\n");break;
case 6:printf("D\n");break;
case 7:printf("C\n");break;
case 8:printf("B\n");break;
case 9:
case 10:printf("A\n");break;
default:printf("Score is error!\n");
}
}
return 0;
}


 

0.0分

1 人评分

看不懂代码?想转换其他语言的代码? 或者想问其他问题? 试试问问AI编程助手,随时响应你的问题:

编程语言转换

万能编程问答

代码解释器

  评论区