题目内容

1、 class Program{static void Main(string[] args){string str1 = "中华人民共和国于一九四九年建立";StringDe ob = new StringDe();ob.f(str1);Console.Read();}}class StringDe{public void f(string s){for (int j = 0; j < s.Length; j += 2)Console.Write(s[j]);return;}}产生的输出结果是什么?

查看答案
更多问题

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);}}产生的输出结果是什么?

答案查题题库