以下程序的运行结果为? 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
举一反三
- 以下程序的运行结果为( ) public class Ex6 { public static void main(String[] args) { int i,j,k; for(i=0;i<3;i++){ for(j=1;j<4;j++){ for(k=2;k<5;k++){ if((i==j)&&(j==k)) System.out.println(i); } } } } }
- 05610012:以下程序输出结果为( )。 int main() { int i,b,k=0; for(i=1;i<=5;i++) { b=i%2; while (b-->=0) k++; } printf("%d,%d ",k,b); return0; }
- 以下程序的输出结果是______ 。#include int main(void) { int i, k = 19; while(i = k - 1) { k -= 3; if(k % 5 == 0) { i++; continue; } else if(k < 5) break; i++; } printf("i=%d,k=%d", i, k); return 0;}
- 写出以下程序运行结果。using System;class Test{const int N=5;public static void Main (){int a = 0;for(int i=1; i<;N; i++) {int c=0, b=2;a+=3; c=a+b;Console.writeLine (c + ““ );}}}
- 写出以下程序运行结果。const int N=5; public static void Main (){ int a = 0; for(int i=1; i<;N; i++) { int c=0, b=2; a+=3; c=a+b; Console.write (c + “ ” ); }程序运行后输出结果为:____