[单选题]

下面程序的输出结果为()。includeclass CStatic{public:CStatic(){val£«£«;}static in

下面程序的输出结果为( )。 #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{publi

[单选题]下面程序的输出结果为()。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;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{public: A( ) {

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

    [单选题]下面程序的输出结果是()。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;p

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

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

    [单选题]执行以下程序后的输出结果为( )。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;

    [单选题]下面程序的运行结果为( )。 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 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{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 CStatic{publi