下列程序中的错误,有():Scannerin=newScanner(System.in);Syste

2022-09-22 10:12 括号

下列程序中的错误,有():Scannerin=newScanner(System.in);System.out.println("请输入您的幸运数字:");intn=in.nextInt();Stringresult="";switch(n)case1case2:case5:result="抱歉哦,运气就差那么一点点!";break;case3:case2:result="恭喜您中奖了!";break;default:result="请您再试试!";break;}System.out.println(result);

A.括号不配对

B.case选项重复

C.switch表达式的值的类型不合法

D.没有跳转语句

正确答案:AB
相关推荐
下列程序中的错误,有():Scannerin=newScanner(System.in);Syste