题解 | #判断成绩等级#
判断成绩等级
http://www.nowcoder.com/practice/1a12e246764243ada9043699b9a1e7ef
#include using namespace std;
int main() {
int score;
cin >> score;
// write your code here......
if(score>=0 && score<=100){//大循环体控制输入数据是否合法
if(score>=90)//成绩大于等于90
printf("优秀");
else if(score>=80)//成绩大于等于80
printf("良");
else if(score>=70)//成绩大于等于70
printf("中");
else if(score>=60)//成绩大于等于60
printf("及格");
else//都不满足的话,则是不及格输出 差
printf("差");
}
else
printf("成绩不合法");
return 0;
}