• 2021-04-14
    以下代码的输出结果是_________。 public static void main(String[] args){ for(int i=1;i<=10;i++){ if(i%2==0 || i%5==0){ continue; } System.out.print(i+"\t"); } }
  • 1 3 7 9

    内容

    • 0

      阅读下面的代码 public static void main(String&#91;&#93; 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)); } } 下列选项中,程序的输出结果是

    • 1

      阅读下面的代码,输出结果是() public static void main(String&#91;&#93; 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)); } } A: 3.030130301E9 B: 5.04813268E9 C: 3.268023579E9 D: 1111111111

    • 2

      以下代码的输出结果是_________。publicstaticvoidmain(String&#91;&#93;args){for(inti=1;i&lt;=10;i++){if(i%2==0||i%5==0){continue;}System.out.print(i+"\t");}} A: 1 B: 134 C: 13579 D: 1379

    • 3

      以下程序的运行结果为? class Test2{ public static void main(String[] args) { int[] seeds = {1,2,3,5}; int n = seeds.length; for (int i = 0; i < 2; i++) for (int k = 0; k< n-1; k++) seeds[k]= seeds[k+1]; for (int i = 0; i 输出: 3 5 5 5

    • 4

      下面代码的运行结果是。 public class Test { public static void main(System&#91;&#93; args){ int&#91; &#93; a ={10,20,30}; int&#91; &#93; b ={1,2,3,4,5}; a=b; for (int i=0;i<a.length;i++){ System.out.print(a[i]+” ”); } } }[/i]