【填空题】以下程序执行后的输出结果是 : static void Main(string[] args) { Console.Write ("Good Morning"); Console.Write("How areyou?"); Console.Write("Well"); Console.ReadKey(); } 结果为:
举一反三
- 输入一个整数,将各位数字反转后输出,将程序填充完整static void Main(string[] args){Console.WriteLine("请输入一个整数");string x = Console .ReadLine ();int y = int.Parse (x);for(int i=0;i<;x.Length ;i++){Console.Write(y%10);;}}
- 下面程序段的运行结果 static void Main(string[] args) { int a = 0; for (int i = 1; i < 5; i++) { int c = 0, b = 2; a += 3; c = a + b; Console.Write(c + ","); } } 程序运行结果是( )
- 阅读以下程序class A{public A(int n){Console.Write(“A”);}public A(string s,int n):this(0){Console.Write(“C”);}}class B:A{public B(int n):base(0){Console.Write(“B”);}}class Test{static void Main(){B b = new B(1);}}以上程序运行后的输出结果是() A: BC B: AB C: BA D: CB
- 下列代码输出为( ): class Father{ public void F() { Console.Write("A.F"); } public virtual void G() { Console.Write("A.G"); } } class Son: Father{ new public void F() { Console.Write("B.F"); } public override void G() { Console.Write("B.G"); } } class override_new{ static void Main() { Son b = new Son(); Father a = b; a.F(); b.F(); a.G(); b.G(); } }
- C#语言中的类Console包含两个输入方法:Write( )和WriteLine( )。它们之间的唯一区别是( )。 A: WriteLine( )方法输出后换行,Write( )方法输出后不换号 B: Write( )方法输出后换行,WriteLine( )方法输出后不换号