写出以下程序运行结果。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 + “ ” ); }程序运行后输出结果为:____
- using System; class Test { public static void Main () { int[ ] a ={2,4,6,8,10,12,14,16,18}; for (int i=0; i<9; i++) { Console.write(“ ”+a[i]); if ((i+1)%3==0) Console.writeLine(); } } }[/i]
- 以下程序的运行结果为? 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 Test { public static void main(String[] args) { int a = 0; int b = 0; for (int i = 1; i <= 5; i++) {
- 下面程序的运行结果是 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); } }