题目内容

1、 class Example1{public static void Main(){int x = 1, a = 0, b = 0;switch(x){case 0:b++;break;case 1:a++;break;case 2:a++;b++;break;}Console.WriteLine( “a = {0}, b = {1} ”, a, b);}}产生的输出结果是什么?

查看答案
更多问题

1、 class Program{static void Main(string[] args){int x=5;int y=x--;Console.WriteLine("y={0}",y);y=--x;Console.WriteLine("y={0}",y);}}产生的输出结果是什么?

1、 class Program{public void Main(string[] args){int[] a = { 1, 2, 3, 4, 5, 6, 7, 8 };int s0, s1, s2;s0 = s1 = s2 = 0;for (int i = 0; i < 8; i++){switch (a[i] % 3){case 0: s0 += a[i]; break;case 1: s1 += a[i]; break;case 2: s2 += a[i]; break;}}Console.WriteLine(s0+""+s1+""+s2);}}产生的输出结果是什么?

1、 class Program{static void Main(string[] args){int x,y=0;do{x=y++;Console.Write(x+”,”);}while(y<6);}}产生的输出结果是什么?

1、 class Program{public static void Main(string[] args){int s = 0, i = 1;for (; ; i++){if (s > 50) break;if (i % 2 == 0) s += i;}Console.WriteLine(" i,s=" + i + "," + s);}}产生的输出结果是什么?

答案查题题库