首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #include #include using std::cout; class Point{ public: friend double distance(const Point &p); //
有如下程序: #include #include using std::cout; class Point{ public: friend double distance(const Point &p); //
admin
2017-10-17
43
问题
有如下程序:
#include
#include
using std::cout;
class Point{
public:
friend double distance(const Point &p); //P距原点的距离
Point(int xx=0,int yy=0):x(xx),Y(YY){}//①
private:
int x,y;
};
double distance(const Point &p){ //②
return sqrt(P.x*P.x+P.y*P.y);
}
int main(){
Point p1(3,4);
cout<
return 0; //③
}
下列叙述中正确的是
选项
A、程序编译正确
B、程序编译时语句①出错
C、程序编译时语句②出错
D、程序编译时语句③出错
答案
A
解析
转载请注明原文地址:https://kaotiyun.com/show/aPAp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
下列叙述中错误的是
下列关于数据库系统的叙述中,正确的是()。
有如下程序:#include<iostream>usingnamespacestd;classAA{public:virtualvoidf(){cout<<
若有如下语句#include<iostream.h>voidmain(){intx=3;do{x=x-2cout<<x;{while(!(--x);}则上面程序段
下列运算符中全都可以被友元函数重载的是()
下面对静态数据成员的描述中,正确的是()。
以下有关析构函数的叙述不正确的是
有关构造函数的说法中错误的是
已知一个函数模板定义为:template<typenameT1,typenameT2>T1FUN(T2n){returnn*5.0;}若要求以int型数据7为函数实参调用该模板函数,并返回一个double型数据,则该调用
随机试题
下列不属于库存现金内部控制活动的是()
FrankLloydWrightprobablyisthegreatestarchitectthattheUnitedStateshaseverproduced.Hewasvery【21】andhadanatural
A.血管紧张素ⅠB.血管紧张素ⅡC.去甲肾上腺素D.醛固酮E.肾素
2007年甲公司委托乙公司加工商品一批(属于应税消费品)。有关经济业务如下:(1)1月5日,发出材料一批,计划成本为400000元,材料成本差异率为2%。(2)2月8日,支付商品加工费20000元,支付应当交纳的消费税43000元。该
()根据托运人的要求,将同一船舶的同一装货港、同一卸货港、同一收货人的两批或两批以上相同或不同的货物合并签发的一套提单。
社会总需求是指()。
下列场景最不可能发生的是()。
Amajorreasonforconflictintheanimalworldisterritory.Themaleanimal【1】anarea.Thesizeoftheareaissufficienttop
Ifyou’vegotanearforlanguages,askillofcodingorasteadyhandanddon’tfaintatthesightofbloodthenyourcareerlo
ScientistssaytherehasbeenaseveredecreaseintheamountofwaterinLakeChadinnorthernAfricainthelastthirtyyears.
最新回复
(
0
)