1)在C#中,下列代码的运行结果是( )。(选择一项) using System; class Test{ static void Main(string[] args){ int a = 21; int b = 22; int c = 23; if (a < b) { Console.WriteLine(b); } else { Console.WriteLine(a + b + c); } } }
A: A.21
B: B.22
C: C.23
D: D.66
A: A.21
B: B.22
C: C.23
D: D.66
举一反三
- 在C#中,下列代码的运行结果是( )using System;class Test{ Public static void Main(string[] args) { int a=21,b=22,c=23; if(a<b) Console.WriteLine(b); else Console.WriteLine(a+b+c); }} A: 21 B: 22 C: 23 D: 66
- 在C#中,下列代码的运行结果是()using System;class Test{Public static void Main(string[] args){int a=21,b=22,c=23;if(a<;b)Console.WriteLine(b);elseConsole.WriteLine(a+b+c);}} A: 21 B: 22 C: 23 D: 66
- 写出以下程序的输出结果。using System; class Program { public static void Main(string[] args) { int a=5,b=4,c=6,d; Console.WriteLine(“{0}”,d=a>b?(a>c?a:c):b); } }运行结果:_________。
- using System; class Test { public static void Main() { int x = 5; int y = x++; Console.WriteLine(y); y=++x; Console.WriteLine(y); } }
- 写出以下程序运行结果。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 + ““ );}}}