现有如下程序: public static void main(String[] args){ int i=0;[br][/br] System.out.print(i++); System.out.print(i++); System.out.print(i++); System.out.print(i); int j=0; System.out.print(++j); System.out.print(++j); System.out.print(++j); System.out.print(j); }
A: 01231233
B: 01230123
C: 12331233
D: 12301234
A: 01231233
B: 01230123
C: 12331233
D: 12301234
举一反三
- 下列选项中,循环会无限执行的是______。 A: int i = 1 ; while ( i < 10) System .out .print( “ ” + i) ; B: for( int i = 1 ; i < 10 ;i ++) System .out .print( “ ” + i); C: for( int i = 10 ; i > 0 ;i --) System .out .print( “ ” + i); D: int i = 1 ; while (true) { System .out .print( “ ” + i); i ++ ; if ( i > 5) break ;
- 下列程序的运行结果是()。 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 static void main(String[] args) { Random random1 = new Random(10); Random random2 = new Random(10); for(int i=0;i<5;i++){ System.out.print(random1.nextInt(5)); } for(int i=0;i<5;i++){ System.out.print(random2.nextInt(5)); } }
- 下列程序执行后之后,将会输出 ()。public class A {public static void main(String[] args){int j = 0;for (int i = 3; i >;= 0; i--) {j += i;System.out.print(j);}}} A: 3566 B: 3522 C: 6753 D: 3255
- 阅读下面的代码 public static void main(String[] args) { Random random1 = new Random(10); Random random2 = new Random(10); for(int i=0;i<5;i++){ System.out.print(random1.nextInt(5)); } System.out.println(); for(int i=0;i<5;i++){ System.out.print(random2.nextInt(5)); } } 下列选项中,程序的输出结果是