纠错
全专业资料、题库、学位、网课
最高直省2344元
上千+科次精品网课
买网课即送全真模考题库
五千+科次教材资料
电子资料满三件9折
五千+科次在线题库
全真呈现历年考试试题
1、[单选题]设有函数:T max(T x,T y){return x==y?x:y;},其中T为模板类型,下列相
关分析正确的是( )
2、[填空题]函数调用语句“aver(x+(x+y),+十z,sqrt(x+a),max(x,f(y)))”中,实参的个数是______。
3、[主观题]【程序分析题】#include
using namespace std;class Complex
{
private:
double realPart,imagePart;
public:
Complex(double real=0,double image=0):realPart(real),imagePart(image){}Complex operator-(const Complex&a)const{
return Complex(realPart-
realPart,imagePart-
imagePart);}void Show(const{cout<
Complex a(2,9),b(1,1),c;c=a-b;
cout<<"a=";
Show(;cout<<"b="";
Show(;cout<<"c=";
ShowO;return 0;
}
【原题如下】
4、[主观题]【程序分析题】#include
#include
double x=10.456;
cout<
【原题如下】
5、[主观题]【程序填空题】程序用来求直角三角形斜边长度,运行结果为5。
#include
#include
{
private:
double x,y;
(1):______
public:
Point(double i=0,double j=O){x=i;y=j;}Point(Point&p){x=p.x;y=p.y3}
};
class Line{
private:
Point p1,p2;
public:
Line(Point&xp1,Point&xp2):p1(xp1),p2(xp2)0double GetLengthO
double dx=p2.x-p1.x;double dy=p2.y-p1.y;return sqrt(dx*dx+dy*dy);
};
int main(){
Point L1,L2(3,4);//两条直角边的长度Line L3(L1,L2);
cout<<__(2)_<
【原题如下】
Copyright © 2010 - 2023 湖南求实创新教育科技有限公司 All Right Reserved.
温馨提示:如您需要的资料本网暂时没有,请于工作日08:00-18:00,点击这里,联系客服及时补充资料。