首页 > 编程语言 > 详细

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

时间:2021-06-08 09:56:03      阅读:19      评论:0      收藏:0      [点我收藏+]
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);



}

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

原文:https://www.cnblogs.com/wuxiaobeistudy007/p/14860853.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!