[单选题]

下面程序的运行结果为( )。 include

class 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.11

B.12

C.21

D.22

参考答案与解析:

相关试题

下面程序的运行结果为()。#includeclass A{int numpubl

[单选题]下面程序的运行结果为()。includeclass A{int numpublic:A(int i){num=i;}A(A&a下面程序的运行结果为( )。 #include<iostream.h> class A { int num public: A(int i){num=i;} A(A&a){Bum=a.num++;} void print(){cout<<Bum;} }; void main() { A a(1),b(a); A. print(); B.print(); }

  • 查看答案
  • 下面程序的运行结果为#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

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

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

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

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

  • 查看答案
  • 下面程序的运行结果为#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 hum;