6、{x=4;}else{x=3;}Console.WriteLine("x={0}”,x);}答案:52、{intx,y=0;do{x=y++;Console.WriteLine(x);}while(y<6);}答案:153、classTest{staticvoidMain(){intx=5;inty=x--;Console.WriteLine("y={0}",y);y=--x;Console.WriteLine("y={0}",y);}}答案:5,54、classTest{ public staticvoidMa
7、in() { static int[]a={1,2,3,4,5,6,7,8};int s0,s1,s2; s0=s1=s2=0; for (inti=0;i<8;i++) { switch (a[i]%3) {case 0:s0+=Test.a[i];break; case 1:s1+=Test.a[i];break; case 2:s2+=Test.a[i];break; }} Console.WriteLine(s0 +""+s1+""+s2);}}答案:9+