day03-流程控制语句-判断流程-if格式三的使用和练习

This commit is contained in:
2026-01-14 16:57:53 +08:00
parent 3a88efe254
commit fe3254567a

View File

@@ -8,4 +8,20 @@ package com.inmind.if01;
60以下 不及格
*/
public class Test04 {
public static void main(String[] args) {
int score = 100;
if(score<0 || score>100){
System.out.println("你的成绩是错误的");
}else if(score>=90 && score<=100){
System.out.println("你的成绩属于优秀");
}else if(score>=80 && score<90){
System.out.println("你的成绩属于好");
}else if(score>=70 && score<80){
System.out.println("你的成绩属于良");
}else if(score>=60 && score<70){
System.out.println("你的成绩属于及格");
}else {
System.out.println("你的成绩属于不及格");
}
}
}