下面程序的运行结果为( )。 #includeiostream.h class A { public: A{tout”1”;} ~A{tout”2”;} }; class B:public A { public: B{cout”3”;} ~B{cout”4”;} }; void main { B b; }A.1234B.1324C.1342D.3142
下面程序的运行结果为( )。 #include<iostream.h> class A { public: A{tout<<”1”;} ~A{tout<<”2”;} }; class B:public A { public: B{cout<<”3”;} ~B{cout<<”4”;} }; void main { B b; }
A.1234
B.1324
C.1342
D.3142
相关考题:
下面程序的运行结果为includeclass A{int num;public:A(int i){num=i;}A(A a) 下面程序的运行结果为 #include<iostream.h> class A { int num; public: A(int i){num=i;} A(A a) { num = a.num+ +;} void print( ) {cout << num;} }; void main( 0 { A a (1),b (a) ; a.print( ); b.A.11B.12C.21D.22
下面程序的运行结果为 include Class Astatic int n; public: A( ) {n=1;} A(int n 下面程序的运行结果为#include<iostream.h>Class Astatic int n;public:A( ) {n=1;}A(int num) {n=num;}void print( ) {cout < < n;}};int A: :n=2;void main( ){A a,b(3) ;a. print( ) ;b. print( ) ;cout < < endl;}A.11B.13C.23D.33
下面程序的运行结果是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: base1( ){cout<<"1";} }; class base2:virtual base{ public:A.123B.3120C.312D.3012
下面程序的运行结果为 include class A { public: A( ) {cout 下面程序的运行结果为#include<iostream. h>class A{public:A( ) {cout < <"1";}~A( ) {cout < <"2";}};class B:public A{public:B( ) {cout < <"3";}~B( ) {cout < <"4";}};void main( ){B b;}A.1234B.1324C.1342D.3142
下面程序的运行结果为include class A{ static int n;public:A( ){n=1;}A(int nu 下面程序的运行结果为 #include < iostream.h > class A { static int n; public: A( ){n=1;} A(int num){ n = num;} void print( ){cout<< n;} }; int A::n=2; void main( ) { A a,b (3); a.print( ); b.print( ); cout<< end1; }A.11B.13C.23D.33
下面程序的运行结果为includeclass A{ int num;public: A(int){num=i;} A(ABm){num 下面程序的运行结果为 #include<iostream.h> class A { int num; public: A(int){num=i;} A(ABm){num=a.num++;} void print(){cout<<num;} }; void main() { Aa(1),b(a); a.print(); b.print(); }A.11B.12C.21D.22
下面程序的运行结果为( )。 include using namespace std; class A{ pu 下面程序的运行结果为( )。 #include <iostream> using namespace std; class A{ public: A(){cout<<" ";} ~A(){cout<<" ";} } class B:public A{ public: B(){cout<<" ";} ~B(){cout<<" ";} } void main(){ B b; }A.1234B.1324C.1342D.3142
下面程序的运行结果为includeclass A{public: A( ){cout 下面程序的运行结果为 #include<iostream.h> class A { public: A( ){cout<<"1";} ~A( ){cout<<"2";} }; class B:public A { public: B( ){cout<"3";} ~B( ){cout<<"4";} }; void main( ) { BA.1234B.1324C.1342D.3142
下面程序的运行结果为includeclass A{static int n;public: A(){n=1;} A(intnum){n 下面程序的运行结果为 #include<iostream.h> class A { static int n; public: A(){n=1;} A(intnum){n=num;} void print(){cout <<n;} }; int A∷n=2; void main() { Aa,b(3); a.print(); b.print(); cout <<end1; }A.11B.13C.23D.33
下面程序的运行结果为includeclass A{public:A(){cout 下面程序的运行结果为 #include<iostream,h> class A { public: A(){cout<<"1";} ~A(){cout<<"2";} }; Class B:public A { public: B(){cout<<"3";} ~B(){cout<<"4";} }; void main() { B b; }A.1234B.1324C.1342D.3142