下面程序的输出结果是()。include using namespace std;class point {public:point(in 下面程序的输出结果是( )。 #include <iostream> using namespace std; class point { public: point(int px=10,int py=10){ x=px;y=py;} getpx( ) { return x;} getpy( ) { return y;} private: int x,y; }; void main(voiD) { point p,q(15,15); cout<<"p点的坐标是:"<<p. getpx( )<<" ,"; cout<<p. getpy( )<<endl; cout<<"q点的坐标是:"<<q. getpx( )<<" ,"; cout<<q. getpy( ); }A.p点的坐标是:10,10 q点的坐标是:15,15B.p点的坐标是:0,0 q点的坐标是:15,15C.p点的坐标是:0,0 q点的坐标是:0,0D.p点的坐标是:10,10 q点的坐标是:10,10

下面程序的输出结果是()。include using namespace std;class point {public:point(in

下面程序的输出结果是( )。 #include <iostream> using namespace std; class point { public: point(int px=10,int py=10){ x=px;y=py;} getpx( ) { return x;} getpy( ) { return y;} private: int x,y; }; void main(voiD) { point p,q(15,15); cout<<"p点的坐标是:"<<p. getpx( )<<" ,"; cout<<p. getpy( )<<endl; cout<<"q点的坐标是:"<<q. getpx( )<<" ,"; cout<<q. getpy( ); }

A.p点的坐标是:10,10 q点的坐标是:15,15

B.p点的坐标是:0,0 q点的坐标是:15,15

C.p点的坐标是:0,0 q点的坐标是:0,0

D.p点的坐标是:10,10 q点的坐标是:10,10


相关考题:

( 29 )有如下程序:#includeusing namespace std;class point {public:static int number;public:point () {number++;~ point () {number-;}};imt point::number=0;void main () {point*ptr;printA,B;{point*ptr_point=new point{3};ptr=ptr_point;}pointC;coutPOINT::NUMBERENDL;delete[]ptr;}运行时输出的结果是A ) 3B ) 4C ) 6D ) 7

下列程序的输出结果为: Ohject id=0 Object id=1 请将程序补充完整。 include us 下列程序的输出结果为:Ohject id=0Object id=1请将程序补充完整。include <iostream>using namespaee std;class Point{public:Point(int xx=0,intyy=0){X=xx;Y=yy;countP++;}~Point( ){countP--;}int GetX( ){return X;}int GetY( ){return Y;}static void GetC( ){ cout<<"Object id="<<<countP<<endl;}private:int X,Y;static int countP;};______ //静态数据成员的初始化int main( ){Point::GetC( );Point A(4,5);A.GetC( );return 0;}

有如下程序:includeusing namespace std;class Point{public: static int number; 有如下程序:#include<iostream>using namespace std;class Point{public: static int number;public: Point(){number++;} ~Point(){number--;}};int Point::number=0;void main(){ Point*ptr; Point A,B; { Point*ptr_point=new Point[3]; ptr=pb_point; } Point C cout<<Point::number<<endl; delete[]ptr; }运行时输出的结果是A.3B.4C.6D.7

下面程序的输出结果是【】。include include class point{double x; double y; 下面程序的输出结果是【 】。include <iostream.h>include <math.h>class point{double x;double y;public:point(double a, double b){x=a;y=b;}friend double distance(point a, point b) ;};double distance(point a, point b){return sqrt ((a. x-b.x) * (a. x-b.x)+ (a. y-b. y) * (a. y-b. y) );}void main(){point p1(1,2);point p2(5,2);cout<<distance(p1,p2)<<end1;}

下列程序的输出结果为: bjectid=O biectid=1 请将程序补充完整。 include using namesp 下列程序的输出结果为:bjectid=Obiectid=1请将程序补充完整。include<iostream>using namespace std;class Point{public:Point(int xx=0,int yy=0){X=xx;Y=yy;countP++;}~Point(){countP--;}int GetX(){return X;}int GetY(){return Y;}static void GetC(){cout<<"Object id="<<countP<<endl;}private:int X,Y;static int countP;};______//静态数据成员的初始化int main(){Point::GetC();Point A(4,5);A.GetC();return 0;}

有以下程序: include using namespace std; class Point' { public: void SetPoint( 有以下程序: #include <iostream> using namespace std; class Point' { public: void SetPoint(int x,int y); void Move(int xOff,int yOff); int GetX() { return X; } int GetY() { return Y; } private: int X,Y; }; void Point::SetPoint(int x, int y) { X=x; Y=y; } void Point: :Move(int xOff, int yOff) X+=xOff; Y+=yOff; } int main () { Point p1; p1.SetPoint(1,2); p1.Move (5, 6); cout<<"Point1 is ("<<p1.GetX()<<','<<p1.GetY()<<")"<<end1; return 0; } 执行后的输出结果是( )。A.Point1 is (6,8)B.Point1 is (1,2)C.Point1 is (5,6)D.Point1 is (4,4)

下列程序的输出结果为 Object id=0 Obiect id=1 请将程序补充完整。 include using nam 下列程序的输出结果为Object id=0Obiect id=1请将程序补充完整。include<iostream>using namespace std;class Point{public:Point(int xx=O,int yy=O){X=xx;Y=yy;countP++;}~Point(){countp--;}int GetX()(return X;)int GetY(Xremm Y;)static void GetC(){cout<<"Objcetid="<<countp<<endl;}private:int X,Y;static int countP;}:【 】。 //静态数据成员的初始化int main(){Point::GetC();Point A(4,5);A.GetC()return 0;}

下列程序的输出结果为 Object id=0 Object id=1 请将程序补充完整。 include using na 下列程序的输出结果为Object id=0Object id=1请将程序补充完整。include <iostream>using namespace std;class Point{public:Point(int xx=0,int yy=0) {X=xx;Y=yy;countP++;}~Point(){countP--;}int GetX(){return X;}int GetY(){return Y;}static Void GetC(){cout<<"Object id="<<countP<<endl;}private:int X,Y;static int countP;};______ //静态数据成员的初始化int main (){Point::GetC();Point A(4,5);A.GetC();return 0;}

有如下程序: #inCludeiostream using namespaCe std; Class Point{ publiC: statiC int number; publiC: Point( )t.number++;} ~Point( ){number--;} }; , int P0int::number=0; int main( ){ Point *ptr: Point A,B; Point*ptr_point=new Point[3]; ptr=ptr_point;’ } Point C; CoutPoint:::numberendl; delete[]ptr; return 0; } 执行这个程序的输出结果是( )。A.3B.4C.6D.7

下面程序的输出结果是()。include using namespace std;class A {public:A( ) {cout 下面程序的输出结果是( )。 #include <iostream> using namespace std; class A { public: A( ) {cout<<"A";} } class B { public: B() {coat<<"B" ;} } class C: public A { public: B b; C() {cout<<"C";} } void mian(){ C c; }A.CBAB.ABCC.ACBD.BCA