public class switch {
public static void main(String[] args) {
int score=95;
int i=score/10;
switch(i){
case 10 :
case 9 :
case 8 :System.out.println("优秀"); break;
case 7 :System.out.println("良好"); break;
case 6 :System.out.println("及格"); break;
default :System.out.println("不合格");
}
}
}
报错如下 :
C:\switch.java:11: <identifier> expected
public class switch {
^
C:\switch.java:29: '{' expected
^
2 errors
Process completed.