有以下程序inclube class ClassOne{public: ClassOne(int v=O) { i=v;cout 有以下程序 #inclube <iostream.h> class ClassOne { public: ClassOne(int v=O) { i=v;cout<<i;} void print(){ cout<<i<<end1;} }; class ClassTwo { public: ClassTwo(int v=O) { i=v;cout<<i;} void print(){ cout<<i<<end1;} private: ClassOne myObj; int i; }; void main() { ClassTwo obj(1); obj.print(); }A.11B.111C.110D.101

有以下程序inclube class ClassOne{public: ClassOne(int v=O) { i=v;cout<

有以下程序 #inclube <iostream.h> class ClassOne { public: ClassOne(int v=O) { i=v;cout<<i;} void print(){ cout<<i<<end1;} }; class ClassTwo { public: ClassTwo(int v=O) { i=v;cout<<i;} void print(){ cout<<i<<end1;} private: ClassOne myObj; int i; }; void main() { ClassTwo obj(1); obj.print(); }

A.11

B.111

C.110

D.101


相关考题:

有如下程序:#includeusing namespace std;class ONE{public:virtual void f(){cout"l";}};class TWO:public ONE{public:TWO(){cout"2";}};class THREE:public TWO{public:virtual void f(){TWO::f(); cout"3";}};int main(){ONE aa, *p;TWO bb;THREE cc;p = cc;p-f();return 0;}执行上面程序的输出是 【 11 】 。

有如下程序: include using namespaee std; class ONE{ public: virtual void f 有如下程序:include <iostream>using namespaee std;class ONE{public:virtual void f( ){cout<<"1";}};class TWO:public ONE{public:TWO( )1 cout<<"2";}{;class THREE:public TWO{public:virtual void f( )}TWO::f( );cout<<"3";}};int main( ){ONE aa,*P;TWO bb;THREE cc;P=cc;p->f( );return 0;}程序的输出结果是______。

有如下程序: include using namespace std; class ONE { public: virtual void f() { 有如下程序:include <iostream>using namespace std;class ONE{public:virtual void f() { cout << "1"; }};class TWO: public ONE{public:TWO() { cout << "2"; }};class THREE: public TWO{public:virtual void f() {TWO::f(); cout << "3"; }};int main(){ONE aa, *p;TWO bb;THREE cc;p=cc;P->f();return 0;}执行上面程序的输出是【 】。

以下程序的正确运行结果是()。includeint f(int);void main(){int a=2,i;for(i=0;i 以下程序的正确运行结果是( )。 #include<iostream.h> int f(int); void main() { int a=2,i; for(i=0;i<3;i++)cout<<f(a)<<" "; cout<<endl; } int f(int a) { int b=0; static int c=3; b++;c++; return(a+b+c); }A.777B.7 10 13C.7 9 11D.7 8 9

有如下程序:#includeiostreamusing narnespace std;class ONE{int e;public:ONE():c(O){cout1;)ONE(int n):c(13){cout2;}};class TWO{ONE oriel;ONE one2,public:TWO(int m):one2(m){cout3;}};int main(){TWO t(4);return O;}运行时的输出结果是A.3B.23C.123D.213

有下列程序:includeusing namespace std;class ONE{ public:virtual void f(){COUt 有下列程序:include<iostream>using namespace std;class ONE{public:virtual void f(){COUt<<"1";}};c1assTWO:public ONE{public:TWO(){cout<<"2";}};class THREE:public TWO{pub

下面程序的运行结果为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 class S{ int A[10]; public: int operato 分析以下程序的执行结果【 】。include <iostream. h>class S{int A[10];public:int operator () (int);};int S: :operator() (int x) {return A[x];}void main() {S a;int i,j;for (i=0; i<10; i++)a(i)=i*2;for (i=0; i<10; i++)cout<<a(i)<<" ";cout<<end1; }

下列程序的运行结果是______。 include class Base { public: virtual void func(int 下列程序的运行结果是______。include<iostream.h>class Base{public:virtual void func(int i){cout<<"class Base:"<<i<<end1;)};class Derived: public Base{public:void func(double d){cout<<"class Derived:"<<d<<endl;}};void main( ){Base a,*p=a;Derived b;p=b;(*p).func(3.3);}