x****a 发帖数: 1229 | 1 int x = 6; int success = 0;
do {
switch(x) {
case 0: System.out.print("0"); x += 5; break;
case 1: System.out.print("1"); x += 3; break;
case 2: System.out.print("2"); x += 1; break;
case 3: System.out.print("3"); success++; break;
case 4: System.out.print("4"); x -= 1; break;
case 5: System.out.print("5"); x -= 4; break;
case 6: System.out.print("6"); x -= 5; break;
}
} while ((x != 3) || (success < 2));
what is the output?
61433 or 6143? |
g**e 发帖数: 6127 | 2 61433呀
【在 x****a 的大作中提到】 : int x = 6; int success = 0; : do { : switch(x) { : case 0: System.out.print("0"); x += 5; break; : case 1: System.out.print("1"); x += 3; break; : case 2: System.out.print("2"); x += 1; break; : case 3: System.out.print("3"); success++; break; : case 4: System.out.print("4"); x -= 1; break; : case 5: System.out.print("5"); x -= 4; break; : case 6: System.out.print("6"); x -= 5; break;
|
x****a 发帖数: 1229 | 3 I choose this answer and it turns wrong.
【在 g**e 的大作中提到】 : 61433呀
|
g**e 发帖数: 6127 | 4 跑了一下就是输出这个
【在 x****a 的大作中提到】 : I choose this answer and it turns wrong.
|
x****a 发帖数: 1229 | 5 yes, I complied, too. not sure if something is wrong. |
x*****p 发帖数: 1707 | 6 61433
The answer from what you see is wrong. |