请阅读下面的程序 public class Test { public static void main(String[] args) { int a = { 2, 0, 4, 1, 8, 3, 5 }; int temp; for (int i = 0; i < a.length - 1; i++) { for (int j = a.length - 1; j > i; j--) { if (aj < aj - 1) { temp = aj; aj = aj - 1; aj - 1 = temp; } } } for (Integer i : a) { System.out.print(i); } }} 下列选项中,哪个是程序的运行结果()
A: 8543210
B: 0123458
C: 2041835
D: 以上答案都不对
A: 8543210
B: 0123458
C: 2041835
D: 以上答案都不对
举一反三
- 请阅读下面的程序 [br][/br]public class Test { [br][/br] public static void main(String[] args) { [br][/br] int a = { 2, 0, 4, 1, 8, 3, 5 }; [br][/br] int temp;[br][/br] for (int i = 0; i [ a.length - 1; i++) { <br] for (int j = a.length - 1; j > i; j--) {[br][/br] if (aj [ aj - 1) { <br] temp = aj; [br][/br] aj = aj - 1; [br][/br] aj - 1 = temp; [br][/br] }[br][/br] }[br][/br] }[br][/br] for (Integer i : a) {[br][/br] System.out.print(i); [br][/br] }[br][/br] }[br][/br]} [br][/br]下列选项中,哪个是程序的运行结果() A: 8543210 B: 0123458 C: 2041835 D: 以上答案都不对
- 下面程序的运行结果是 public class Test { public static void main(String[] args) { int temp = 0; for (int i = 1; i < 5; i++) { for (int j = 0; j < i; j++) { temp++; } } System.out.println(temp); } }
- 请阅读下面的程序public class Test { public static void main(String[] args) { int temp = 0; for (int i = 1; i < 5; i++) { for (int j = 0; j < i; j++) { temp++; } } System.out.println(temp); }}下列选项中,哪个是程序的运行结果() A: 5 B: 9 C: 10 D: 15
- 下列程序的运行结果是()。 public class Test public static void main ( String [ ] args ) int count = 0 for( int i = 1 i < 5 i = 2) for( int j = 1 j< = 10 j = 3) count System .out .print (count ) _
- 以下程序调试结果 public class test { public static void main(String args[]) { int i=1, j=3; while (j>0) { j--; i++; } System.out.println(i); } }