写出以下程序运行结果。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{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 + ““ );}}}
- 下面程序段的运行结果 static void Main(string[] args) { int a = 0; for (int i = 1; i < 5; i++) { int c = 0, b = 2; a += 3; c = a + b; Console.Write(c + ","); } } 程序运行结果是( )
- 以下程序的运行结果为? 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
- 有以下程序: prt[int *m,int n) int i; for(i=0;i<n;i++) m[i]++; main() int a[]=1,2,3,4,5,i; prt(a,5); for(i=0;i<5;i++) printf("%d,",a[i]); 程序运行后输出结果是______。[/i][/i]
- int f() { static int i=0; int s=1; s+=i; i++; return s; } main() { int i,a=0; for(i=0;i<5;i++) a+=f(); printf(“%d ”, a); }输出结果为