[单选题]

下面程序的运行结果为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.11

B.12

C.21

D.22

参考答案与解析:

相关试题

下面程序的运行结果为#includeclass A{ int num;publi

[单选题]下面程序的运行结果为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.2

  • 查看答案
  • 下面程序的运行结果为( )。 class A } public: int num

    [试题]下面程序的运行结果为[ ]。class A} public:int num;A.(int i){num=i;}A.(A &a){num=++a.num;}void print(){cout<<num;}};void main(){A. a(1),b(a);a.print();b.print();}

  • 查看答案
  • 下面程序的运行结果为#includeclass A{public: A( ){c

    [单选题]下面程序的运行结果为includeclass A{public: A( ){cout<<"1";}~A( ){cout<<"2";}}下面程序的运行结果为 #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.1

  • 查看答案
  • 下面程序的运行结果为#includeclass A{public:A(){cou

    [单选题]下面程序的运行结果为includeclass A{public:A(){cout<<"1";} ~A(){cout<<"2";}};C下面程序的运行结果为 #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.

  • 查看答案
  • 下面程序的结果是#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{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:

    [单选题]下面程序的结果是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:

    [单选题]下列程序的运行结果是includeclass A{int a;public:A( ){a=0;}A(int aa) { a=aa; c下列程序的运行结果是 #include<iostream.h> class A { int a; public: A( ){a=0;} A(int aa) { a=aa; cout<<a++; } }; void main( ) { A x,y(2),z(3); cout<<end1; }A.0B.23C.34D.25

  • 查看答案
  • 下面程序的运行结果为( )。 includeclass A { int hum;

    [单选题]下面程序的运行结果为( )。 includeclass A { int hum; public: A(int i){nuln=i;} A(A&A.{num=a.num十+;} void print{eout(<hum;} }; void main A a(1),b(A.; a.print; A print;A.11B.12C.21D.22

  • 查看答案
  • 下面程序的运行结果为#includeclass A{int num;public