第1题:
补充完整下面的模板定义:
template<class Type> //Type为类型参数
class Xtwo{ //由两个Type类型的数据成员构成的模板类
Type a;
Type b;
public:
Xtwo(Type aa=0,Type bb=0):a(aA) ,b(bB) { }
int Compare( ){ //比较a和b的大小
if(a>B) return 1;
else if(a==B) return 0;
else return-1;
}
Type Sum( ){return a+b;} //返回a和b之和
Type Mult( ); //函数声明,返回a和b之乘积
};
template<class Type>
______ ::Mult( ){return a*b;} //Mult函数的类外定义
第2题:
A.Type I
B.Type II
C.Type III
D.Type II和Type III
第3题:
A.<jsp:usebeanid=”mybean”scop=”page”class=”mypackage.d”type=”b”>
B.<jsp:useBeanid=”mybean”scop=”page”class=”mypackage.d”type=”Obiect”/>
C.<jsp:useBeanid=”mybean”scop=”page”class=”mypackage.d”type=”mypackage.a”/>
D.<jsp:usebeanid=”mybean”scop=”page”class=”mypackage.d”type=”a”/>
第4题:
()年,“江湖”3型全封闭型护卫舰535号建成服役,成为中国第一艘全封闭、长桥楼型的护卫舰,中国护卫舰从此开始与世界接轨。
第5题:
车辆识别代号(VIN)中可以使用的字母有()。
第6题:
有如下程序:
include<iostream>
using namespace std;
class Monitor{
public:
Monitor(char t):type(t){ }
void Print( )const
{cout<<"The type of monitor is"<<type< private:
char type;
};
class Computer{
public:
Computer(int i,char C) :______{}
void Print( )const
{eout<<"The computer is"<<id<<endl;mort.Print( );}
private:
int id;
Monitor mon;
};
int main( ){
const Computer myComputer(101,'B');
myComputer.Print( );
return 0;
}
请将程序补充完整,使程序在运行时输出:
The computer is 101
The type of monitor is B
第7题:
A.错误
B.正确
第8题:
在下面程序横线处填上适当内容,使程序输出为:55599。
include <iostream>
using namespace std;
template <class TYPE>
class HisClass
{
TYPE data;
public:
HisClass(TYPE a, TYPE b, TYPE C) ;
TYPE getData(){ return data;)
};
template<class TYPE>
HisClass<TYPE>::HisClass(TYPE a,TYPE b,TYPE C)
{
【 】;
else主f(b>C)
data=b;
else
data=c;
}
int main()
{
HisClass<int> x1(3,4,5),x2(5,3,4),x3(4,5,3),x4(7,8,9),x5(8,7,9);
cout<<x1.getData()<<x2.getData()<<x3.getData()
<<x4.getData()<<X5.getData();
return 0;
}
第9题:
()是中国海军最早安装导弹的护卫舰。
第10题:
我国研发和制造的第一代隐身导弹护卫舰是()。