下面程序的输出结果为( )。 #include<iostream.h> class CStatic { public: CStatic(){val++;} static int val; }; int CStatic::val=0; void main() { CSatic cs1; cout<<cs1.va1<<""; CStatic cs2; CStatic cs3,cs4; cout<<cs2.v
A.14
B.24
C.34
D.54
[单选题]下面程序的输出结果为()。includeclass CStatic{public:CStatic() {val£«£«;}static i下面程序的输出结果为( )。#include<iostream.h>class CStatic{public:CStatic() {val++;}static int val;};int CStatic::val=0;void main(){CStatic cs1;cout<<cs1.val<< "";CStatic cs2;CStatic cs3, cs
[单选题]下面程序的运行结果为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{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 example{int a;public:example(int B.{a=b£«£«下面程序的输出结果是( )。 #include<iostream.h> Class example {int a; public: example(int B.{a=b++;} void print(){a=a+1 cout<<a<<““;} void print()const{cout<<a<<““;} }; void main() {example x(3
[单选题]下面程序的输出结果是includeclass example{ int a;public: example(int b) {a=b£«£«下面程序的输出结果是 #include<iostream,h> class example { int a; public: example(int b) {a=b++;} void print( ){a=a+1;cout<<a<<"";} void print( )const{cout<<a<<"";} }; void main( ) { examp
[单选题]下面程序的输出结果是includeclass example{ int a;public: example(int b){a=b£«£«;下面程序的输出结果是 #include<iostream.h> class example { int a; public: example(int b){a=b++;} void print(){a=a+1; cout<<a<<" ";} void print()const{cout<<a<<" ";} }; void main() { exampl
[单选题]执行以下程序后的输出结果为( )。includeclass Sample{int x, y;public:Sample() {执行以下程序后的输出结果为( )。#include<iostream. b>class Sample{ int x, y; public: Sample() { x=y=0;} Sample(int a, int b) {x=a; y=b; } void disp () { cout<<"x="<<x<<"y="<<y<<end1; }};void main(){
[单选题]下面程序的运行结果为( )。 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 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{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