题解 | #判断成绩等级#

判断成绩等级

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

#include <iostream>
using namespace std;

int main() {

	int score;
	cin >> score;

	// write your code here......
	if (score>100 || score<0){
		cout << "成绩不合法!" << endl;
	}
	if (score >= 90 && score <= 100){
		cout << "优秀" << endl;
	}
	if (score >= 80 && score <= 89){
		cout << "良" << endl;
	}
	if (score >= 70 && score <= 79){
		cout << "中" << endl;
	}
	if (score >= 60 && score <= 69){
		cout << "及格" << endl;
	}
	if (score >= 0 && score <= 59){
		cout << "差" << endl;
	}
	return 0;
}
全部评论

相关推荐

11-07 13:31
怀化学院 Java
勇敢牛牛不怕难:又疯一个
点赞 评论 收藏
分享
评论
点赞
收藏
分享
牛客网
牛客企业服务