[单选题]

下面程序的运行结果是includeclass base{protected:int a;public:base( ){cout<<"0

下面程序的运行结果是 #include<iostream.h> class base{ protected: int a; public: base( ){cout<<"0";} }; class basel:virtual base { public: base1( ){cout<<"1";} }; class base2:virtual base{ public:

A.123

B.3120

C.312

D.3012

参考答案与解析:

相关试题

下面程序的运行结果是()。#includeclass base{protecte

[单选题]下面程序的运行结果是()。includeclass base{protected:int a;public:base(){cout<<下面程序的运行结果是( )。 #include<iostream.h> class base{ protected: int a; public: base(){cout<<“0”;} }; Class basel:Virtual base{ public: basel(){cout<<“1”;} }; Class base2:virtual base{ publ

  • 查看答案
  • 有如下程序:#includeclass Base{protected:int i

    [单选题]有如下程序:includeclass Base{protected:int i;public:int j;};class Derived:pub有如下程序: #include<iostream.h> class Base { protected:int i; public:int j; }; class Derived:public Base { int m; public:int n; }; int main() { Derived d; d.i=0; //[1]d.j=0; //[2]d.m

  • 查看答案
  • 分析下面程序,该程序的运行结果是()。#includeclass TestCla

    [单选题]分析下面程序,该程序的运行结果是()。includeclass TestClass{public;static int m;分析下面程序,该程序的运行结果是( )。 #include<iostream.h> class TestClass { public; static int m; TestClass () { m++; } TestClass(int n) { m=n; } static void test() { m++; } }; int TestClass::m=0; void ma

  • 查看答案
  • 下面程序的结果是 ______。#includeclass A{ public:

    [单选题]下面程序的结果是 ______。includeclass A{ public:virtual voidfun()=0{};};class下面程序的结果是 ______。 #include<iostream.h> class A{ public: virtual void fun()=0{}; }; class B:public A{ public: void fun () {cout<< "new file" ;} }; class C: public A{ public: void fun

  • 查看答案
  • 下面程序的结果是#includeclass A{public:A( ){cout

    [单选题]下面程序的结果是includeclass A{public:A( ){cout<<"construtA"<

  • 查看答案
  • 下面程序的结果是#includeclass A { int a;public:

    [单选题]下面程序的结果是includeclass A { int a;public: A():a(1){} void showa(){cout<<下面程序的结果是 #include<iostream.h> class A { int a; public: A():a(1){} void showa(){cout<<a;} }; class B { int a; public: B():a(2){} void showa(){cout<<a;} }; class C:public A,public B {

  • 查看答案
  • 下面程序的结果是#includeclass A{int a;public:A(

    [单选题]下面程序的结果是includeclass A{int a;public:A( ):a(1){}void showa( ){cout<下面程序的结果是 #include<iostream.h> class A { int a; public: A( ):a(1){} void showa( ){cout<<a;} }; class B { int a; public: B( ) :a(2) {}A.1B.2C.3D.程序有错误

  • 查看答案
  • 下面程序的结果是#includeclass A{int a;public:A(

    [单选题]下面程序的结果是includeclass A{int a;public:A( ) :a(1) {}void showa ( ) {cout下面程序的结果是 #include<iostream.h> class A { int a; public: A( ) :a(1) {} void showa ( ) {cout < < a;} }; class B { int a; public: B( ) :a(2) {} void showa( ) {cout < < a;} }; class C: p

  • 查看答案
  • 下面程序的输出结果是#includeclass A{public: A( ) {

    [单选题]下面程序的输出结果是includeclass A{public: A( ) {cout < < "construtA" < < end下面程序的输出结果是 #include<iostream.h> class A { public: A( ) {cout < < "construtA" < < endl;} Virtual~A( ) {cout < < "destructA" < < endl;}}; class B: public A { }; class C:public A {

  • 查看答案
  • 下面程序的结果是()。#includeclass A{int a;public:

    [单选题]下面程序的结果是()。includeclass A{int a;public:A():a(1){}void showa(){cout<下面程序的结果是( )。 #include<iostream.h> class A { int a; public: A():a(1){} void showa(){cout<<a;} }; Class B { int a; public: B():a(2){} void showa(){cout<<a;} ); class C:public A,public B

  • 查看答案
  • 下面程序的运行结果是#includeclass base{protected:i