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);
}
原文:https://www.cnblogs.com/wuxiaobeistudy007/p/14860853.html