第6周作业2-IF语句大显身手之成绩判断

来源:互联网 发布:矩阵潜袭 pc 编辑:程序博客网 时间:2024/04/29 13:27
import javax.swing.*;    public class GradeIf{    public static void main(String args[]){     int score;     String s=(String)JOptionPane.showInputDialog(null,"输入分数","成绩判断",                      JOptionPane.PLAIN_MESSAGE,null,null,null);              score=Integer.parseInt(s);            {            if(score>=85)                System.out.println("A级");            else if(score>=70&score<85)                 System.out.println("B级");              else if(score>=60&score<70)                   System.out.println("C级");            else if(score<60)                    System.out.println("D级");         }      }   }     






0 0
原创粉丝点击