代碼
提交代碼
// 根據(jù)給定分?jǐn)?shù)向屏幕打印評(píng)級(jí)
public class IfElseIfStatement {
public static void main(String args[]) {
int score = 70;
if (score >= 90) {
System.out.println("優(yōu)秀");
} else if(score >= 70) {
System.out.println("良好");
} else if (score >= 60) {
System.out.println("及格");
} else {
System.out.println("不及格");
}
}
}
運(yùn)行結(jié)果