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); else Console.WriteLine(a+b+c); }} A: 21 B: 22 C: 23 D: 66
- 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
- 写出以下程序的输出结果。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); } }运行结果:_________。
- 下列程序的运行结果是()public class Test {public static void main(String[] args) {String str = NULL;System.out.println(str);}} A:
- public class Test { public static void main(String[] args) { String s1 = "abc"; String s2 = new String ("abc"); System.out.println(s1 == s2); } } 程序运行结果是
内容
- 0
分析以下C#代码,其运行结果是______ using System;class Test{ public static void Main() { int x = 5; int y = x++; y=++x; Console.Write (y); }}
- 1
以下程序的输出结果是() 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); } } A: 5 B: 4 C: 6 D: 不确定
- 2
下列代码的执行结果是 。public class Test {public int aMethod(){static int i=0;i++;System.out.println(i);}public static void main(String args[ ]){Test test = new Test();test.aMethod();}}
- 3
在C#中,下列代码的运行结果是(选一项) static void Main(string[]args) { Console.WrinteLine("运行结果是:{0}","运行结果"); }
- 4
以下程序的运行结果是 public class test{ public static void main(String[] args) { int a; a = 6; System.out.print(a); System.out.print(a++); System.out.print(a); } } A: 666 B: 667 C: 677 D: 676