java学习,if- else if 的循环语句

public class Score {
public void score(int x){
System.out.println("该学生的分数是:"+ x);

if (100>= x && x >=90) {
System.out.println("成绩优秀") ;}
else if ( 90 > x && x >= 80){
System.out.println("良好"); }
else if (80> x && x >= 70){
System.out.println("一般"); }
else if (70> x && x >= 60){
System.out.println("合格"); }
else if (60> x){
System.out.println("不及格"); }
}

public static void main(String[] args){
Score myScore = new Score ();
myScore.score( 80);



}
posted @ 2021-06-07 22:38  贝贝壳呀  阅读(220)  评论(0)    收藏  举报