【分录题】写出下面程序运行结果。 public class Demo { public static void main(String args[]) {
已帮助 人
【分录题】写出下面程序运行结果。 public class Demo { public static void main(String args[]) { int x = 5, y = 10, r = 5; switch (x + y) { case 15: r += x; case 20: r -= y; case 25: r *= x / y; default: r += r; } System.out.println(r); } }
![【分录题】写出下面程序运行结果。 public class Demo { public static void main(String args[]) {](/uploads/allimg/6-2872850Q9.jpg)
回答
共1条回复-
B 本题考查带参数的宏的定义:“#defineADD(x)x+x”中x代表m+n,故s写成s=m+n+m+n*k=1+2+1+2*3=10。
