哪个大佬能帮我看下C语言的这道题吗

哪个大佬能帮我看下C语言的这道题吗ProblemStatementAprogrammingcompetitionsiteAtCoderegularlyholdsprogr... 哪个大佬能帮我看下C语言的这道题吗Problem Statement
A programming competition site AtCode regularly holds programming contests.
The next contest on AtCode is called ABC, which is rated for contestants with ratings less than 1200.
The contest after the ABC is called ARC, which is rated for contestants with ratings less than 2800.
The contest after the ARC is called AGC, which is rated for all contestants.
Takahashi's rating on AtCode is R. What is the next contest rated for him?

Constraints
0≤R≤4208R is an integer.
Input
Input is given from Standard Input in the following format:
R

Output
Print the name of the next contest rated for Takahashi (ABC, ARC or AGC).

Sample Input 1
1199

Sample Output 1
ABC

1199 is less than 1200, so ABC will be rated.

Sample Input 2
1200

Sample Output 2
ARC

1200 is not less than 1200 and ABC will be unrated, but it is less than 2800 and ARC will be rated.

Sample Input 3
4208

Sample Output 3
AGC

Submit
展开
 我来答
丿艾瑞灬莉娅
2018-08-05 · TA获得超过916个赞
知道小有建树答主
回答量:926
采纳率:78%
帮助的人:422万
展开全部
#include <stdio.h>

int main()
{
    int rate;
    
    while( scanf("%d", &rate) != EOF )
    {
        if( rate < 1200 ){
            puts("ABC");
        }else if( rate < 2800 ){
            puts("ARC");
        }else{
            puts("AGC");
        }
    }
    
    return 0;
}
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式