java中switch语句中第11行显示case孤立,为什么( case 10:)
importjava.util.*;classex3_6{publicstaticvoidmain(Stringargs[]){Scannerkb=newScanner(...
import java.util. * ;
class ex3_6
{
public static void main (String args[])
{
Scanner kb = new Scanner(System.in);
int grade;
grade=kb.nextInt();
swicth(grade/10);
{
case 10:
case 9:
System.out.print("优秀");
break;
case8:
System.out.print("良好");
break;
case7:
System.out.print("中等");
break;
case6:
System.out.print("及格");
break;
default:
System.out.print("不及格");
}
}
} 展开
class ex3_6
{
public static void main (String args[])
{
Scanner kb = new Scanner(System.in);
int grade;
grade=kb.nextInt();
swicth(grade/10);
{
case 10:
case 9:
System.out.print("优秀");
break;
case8:
System.out.print("良好");
break;
case7:
System.out.print("中等");
break;
case6:
System.out.print("及格");
break;
default:
System.out.print("不及格");
}
}
} 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询