logo AlgoBeat OnlineJudge
登录 注册

TRC-002 T2 官方题解

作者: TuanTuan_Cat  ·  发布于 2026-09-26 10:36:12  ·  最后修改于 2026-09-26 10:41:04
已通过
审核员:joe_zxq 彩笔 · 2026-09-26 10:41:04

根据题意模拟,输入得分,判断得分所在的等级区间并输出等级即可。

代码

#include<bits/stdc++.h>
using namespace std;
int x;
int main(){
    cin>>x;
    if(x==100) cout<<'S';
    else if(x>94) cout<<'E';
    else if(x>89) cout<<'A';
    else if(x>79) cout<<'B';
    else if(x>69) cout<<'C';
    else if(x>59) cout<<'D';
    else if(x>=0) cout<<'F';
    else cout<<'Z';
    return 0;
}

暂无评论

登录 后即可评论。