题目内容

如下程序声明了一个使用两个通用数据类型的模板类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; }

在下面函数的画线处填上适当的内容,使该函数能够利用递归方法求解字符串str的长度(不得使用系统提供的字符串处理函数)。 int GetLen(char*str){ if( (6) )return (7) ; else return 1+GetLen(str+1); {

答案查题题库