switch结构中的表达式,只能是如下的6种中的之一:byte short char String int 枚举类型 对于学生成绩大于60的,输出合格,低于60输出不合格2021-07-09
Scanner scan= new Scanner(System.in);
int score=scan.nextInt();
switch (score/10){
case 0:
case 1:
case 2:
case 3:
case 4:
case 5:
System.out.println(“不及格”);
break;
case 6:
case 7:
case 8:
case 9:
case 10:
System.out.println(“及格”);
break;
}