题解 | #判断成绩等级#

判断成绩等级

http://www.nowcoder.com/practice/1a12e246764243ada9043699b9a1e7ef


#include <iostream>
#include <string>
using namespace std;
string sc(int score) {
    if (score >= 90 and score <= 100) return "优秀";
    if (score >= 80 and score <= 89) return "良";
    if (score >= 70 and score <= 79) return "中";
    if (score >= 60 and score <= 69) return "及格";
    if (score >= 0 and score <= 59) return "差";
    else return "成绩不合法";
}
int main() {
    
    int score;
    cin >> score;

    // write your code here......
    cout << sc(score) << endl;

    return 0;
}

全部评论

相关推荐

totoroyyw:千年老妖😂
投递华为等公司10个岗位
点赞 评论 收藏
分享
点赞 收藏 评论
分享
牛客网
牛客企业服务