题解 | #判断成绩等级#
判断成绩等级
https://www.nowcoder.com/practice/1a12e246764243ada9043699b9a1e7ef
#include <iostream> using namespace std; int main() { int score; cin >> score; // 判断成绩等级,是否合法 if(score <= 100 && score >=90) cout << "优秀"; if(score <= 89 && score >= 80) cout << "良"; if(score <= 79 && score >= 70) cout << "中"; if(score <= 69 && score >= 60) cout << "及格"; if(score <= 59 && score >= 0) cout << "差"; if(score < 0 || score > 100) cout << "成绩不合法"; return 0; }#零基础学习C++#
C++每日一练 文章被收录于专栏
C++刷题