题解 | #判断成绩等级#

判断成绩等级

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;
}

全部评论

相关推荐

09-13 17:25
亲切的00后在笔试:我也遇到了,所以我早他一步查看图片
点赞 评论 收藏
分享
09-22 15:45
门头沟学院 Java
谁给娃offer我给...:我也遇到了,我说只要我通过面试我就去,实际上我根本就不会去😁
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务