代碼
提交代碼
// 根據給定分數向屏幕打印評級
public class IfElseIfStatement {
public static void main(String args[]) {
int score = 70;
if (score >= 90) {
System.out.println("優秀");
} else if(score >= 70) {
System.out.println("良好");
} else if (score >= 60) {
System.out.println("及格");
} else {
System.out.println("不及格");
}
}
}
運行結果