今天课堂进行了课堂小测,成绩测试
package ceshi; import java.util.Scanner; public class ceshi { public static void main(String []args) { System.out.println("请输入成绩:"); Scanner sc = new Scanner(System.in); int student_num = sc.nextInt(); if(student_num > 0 && student_num < 60) { System.out.println("不及格"); } else if(student_num >= 60 && student_num <= 70) { System.out.println("及格"); } else if(student_num > 70 && student_num <= 80) { System.out.println("中"); } else if(student_num > 80 && student_num <= 90) { System.out.println("良"); } else if(student_num > 90 && student_num <= 100) { System.out.println("优"); } else if(student_num > 0 || student_num <= 100) { System.out.println("成绩输入错误"); } } }