在多重if选择结构中,else总是与它前面最近的那个缺少else的if配对。
A. 正确
B. 错误
下面这段代码的输出结果为( )int year=2050;if(!(year%2==0)){if(year/10==0){System.out.println("进入了if");}}else{System.out.println("进入了else");}System.out.println("退出");
A. 进入了if
B. 退出
C. 进入了else 退出
D. 进入了if 退出
下面这段代码的运行结果是( )。int day = 3;switch (day){case 1:case 3:case 5:System.out.println("学钢琴!");break;case 2:System.out.println("学英语!");default:System.out.println("休息哦!");}
A. 学钢琴!
B. 学钢琴!学英语!休息哦!
C. 学钢琴!休息哦!
D. 没有任何输出
下面程序的输出结果是( )。m=37;n=13;while(m!=n){while(m>n)m=m-n;while(n>m)n-=m;}System.out.println(m);
A. 1
B. 13
C. 2
D. 11