题目内容

下列程序的输出结果为: Ohject id=0 Object 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; }

查看答案
更多问题

如下程序声明了一个使用两个通用数据类型的模板类dataClass,其中构造函数用于初始化两个数据成员,成员函数show用于输出两个数据成员的数值。 #include <iostream> using namespaee std; ______ T1 i: T2 j; public: dataClass(T1 a,T2B) {i=a;j=b;} void show( ){tout<<i<<","<<j<<’\n’;} }; int main( ){ dataClass<int,double>obl(10,0.23); dataClass<char,char*>ob2(’X’,"my data"); obl.show( ); ob2.show( ); return 0; 请将程序补充完整,使程序在运行时输出: 10,0.23 X,my data

补充完整下面的类定义: const double PI=3.14; class Circle{ //圆形物体的抽象基类 protected: double r; //半径 public: Circle(double radius=0):r(radius){} (13) ; //计算圆形物体表面积的纯虚函数声明 }; class Cylinder:public Circle{ //圆柱体类 double h; //高度 public: Cylinder(double radius=0,double height=0); Circle(radius),h(height){} Virtual double Area( ){return 2*PI*r*(r+h);} //计算圆柱体的表面积 };

What’’s the big breakthrough with Dolly, the first cloned animal

A. It makes a clone from an ordinary, adult cell.
B. It makes the first normal and healthy cloned animal.
C. It paves the way to the cloning of human beings.
D. It makes a cloned animal with only mother.

下列程序的输出结果是______。 #include <iostream> #include <cstring> using namespace std; void fun(const char*S,char &C) {e=s[strlen(s)/2];} int main( ){ char str[ ]="ABCDE"; char ch=str[1]; fun(str,ch); cout<<ch; return 0; }

答案查题题库