下面程序的结果为 include int c; class A { private: int a; static int b; publi 下面程序的结果为#include<iostream.h>int c;class A{private:int a;static int b;public:A( ) {a=0;c=0;}void seta( ) {a++;}void setb( ) {b++;}void setc( ) {c++;}void display( ) {cout < < a < < " " < < b < < " " < < c;}};int A: :b=0;void main( ){A a1,a2;a1.seta( ) ;a1.setb( ) ;al .setc( ) ;a2.seta( ) ;a2.setb( ) ;a2.setc( ) ;a2.display( ) ;}A.1 2 1B.1 2 2C.1 1 2D.2 2 2

下面程序的结果为 include int c; class A { private: int a; static int b; publi

下面程序的结果为

#include<iostream.h>

int c;

class A

{

private:

int a;

static int b;

public:

A( ) {a=0;c=0;}

void seta( ) {a++;}

void setb( ) {b++;}

void setc( ) {c++;}

void display( ) {cout < < a < < " " < < b < < " " < < c;}

};

int A: :b=0;

void main( )

{

A a1,a2;

a1.seta( ) ;

a1.setb( ) ;

al .setc( ) ;

a2.seta( ) ;

a2.setb( ) ;

a2.setc( ) ;

a2.display( ) ;

}

A.1 2 1

B.1 2 2

C.1 1 2

D.2 2 2


相关考题:

下面程序的运行结果是includevoid fun(int * a,int * b){ int x= * a; * a = * b;* 下面程序的运行结果是 #include<iostream.h> void fun(int * a,int * b) { int x= * a; * a = * b; * b=x; cout <<*a<< *b<<""; } void main( 0 { int x =1,y =2; fun(x,y); cout<< x << y <<end1; }A.12 12B.12 21C.21 12D.21 21

下列程序的运行结果是()。includevoid fun (int *a,int*b){int*kk=a;a=b;b=k}void 下列程序的运行结果是( )。 #include< iostream.h> void fun (int *a,int*b) {int*k k=a;a=b;b=k} void main() {int a=2004, b=9,*x=a,*y=b; fun(x, y) ; cout<<a<<" "<<b<<endl:}A.20049B.92004C.0D.编译时出错

下面程序错误的语句是 ① include ② void main( ) ③ { ④ int * p=new int[1] ; ⑤ p 下面程序错误的语句是① #include<iostream.h>② void main( )③ {④ int * p=new int[1] ;⑤ p=9;⑥ cout < < * p < <endl;⑦ delete[ ] p;⑧ }A.④B.⑤C.⑥D.⑦

下面程序的运行结果是 include void fun(int * a,int * b) { int x= * a; * a= * 下面程序的运行结果是#include<iostream.h>void fun(int * a,int * b){int x= * a;* a= * b; * b=X;cout < < * a < < * b < <" ";}void main( ){int x=1,y=2;fun(x,y) ;cout < < X < < y < < endl;}A.12 12B.12 21C.21 12D.21 21

下列程序的运行结果是 includeclass Location{private:int X.Y;public:void init(i 下列程序的运行结果是 #include<iostream.h> class Location{ private: int X.Y; public: void init(int=0,int=0); void valueX(int val){X=val;} int valueX( ){ return X;} void valueYA.5 0 6 4B.0 0 6 4C.5 0 6 2D.0 0 6 2

下列程序的运行结果是includevoid fun(int * a,int * b){int * k; k=a; a=b; b=k;} 下列程序的运行结果是 #include<iostream.h> void fun(int * a,int * b) { int * k; k=a; a=b; b=k; } void main( ) { int a=3,b=6, * x=a, * y=b; fun(x, y) ; cout < < a < < " " < < b; }A.6 3B.3 6C.编译出错D.0 0

下列程序的运行结果是 inClude roid fun(int *a,int * b) { int * k; k=a;a=b 下列程序的运行结果是 #inClude<iostream.h> roid fun(int *a,int * b) { int * k; k=a;a=b;b=k;} void main( ) { int a=2004,b=9,* x=a,* y=b; fun(x,y); cout < < a < <" " < < b < < end1;}A.2004 9B.9 2004C.0 0D.编译时出错

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

下列程序的运行结果是includevoid fun(int *a,int *B){int *k;k=a;a=b;b=k;}void m 下列程序的运行结果是 #include<iostream.h> void fun(int *a,int *B) {int *k; k=a;a=b;b=k; } void main( ) {int a=3,b=6,*x=a,*y=b; fun(x,y); cout << a <<" "<< b; }A.63B.36C.编译出错D.0

下面程序的结果为______。include void main() { int 3=1,b=2; bool c=1; if(a>b)||c 下面程序的结果为______。include<iostream.h>void main(){int 3=1,b=2;bool c=1;if(a>b)||c)cout<<“true”<<endl;elsecout<<“false”<<endl;}