首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
有如下程序: #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
38
问题
有如下程序:
#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.h>Classsample{intn;public:sample(inti){n=i;}operato
考虑下面的函数原型:voidf(inta,intb=7,charc=’@’);下面的函数调用中,不合法的是()。
若有如下语句#include<iostream.h>voidmain(){intx=3;do{x=x-2cout<<x;{while(!(--x);}则上面程序段
有如下程序:#include<iostream>#include<iosream>usingnamespacestd;classBASE{charc;public;BASE(charn):c(n){
对下列语句正确的描述是()。constint*x;∥(1)int*constx;∥(2)
以下都是C++语言标识符的是()
已知类A有公用数据成员a,且有A obj2;A * const ptr=new A;则下列语句正确的是
随机试题
在粉末涂料涂装中,只要烘烤时间足够长,烘烤温度高低不会影响粉末涂料的固化程度。
A.预防接种B.睡眠行为C.应酬D.久坐E.吃喝属于保健行为的是
下列工程建设定额中,属于按定额适用范围分类的是()。
重大事件是指上市公司发生的,可能对上市公司股票交易价格产生较大影响,而投资者尚未得知的事件。下列各项中属于重大事件的有()。
甲股份有限公司(本题下称“甲公司”)为母公司,其子公司为乙公司,甲、乙公司适用的所得税税率均为25%。甲乙公司对于固定资产折旧方法、折旧年限、净残值,税法与会计处理相同。甲乙公司按照净利润的10%计提盈余公积。甲乙公司2010~2014发生的内部固定资产交
在二级市场上,证券公司扮演的角色有()。
Peoplesaymoneydoesn’tbuyhappiness.Except,accordingtoanewstudyfromPrincetonUniversity’sWoodrowWilsonSchool,its
AnswerQuestions71to80byreferringtothebriefsonfourfamouscastlesinWales,Britainonthefollowingpage.Answereach
______foundfour-leafcloverisconsideredaluckysign.
Musicproducesprofoundandlastingchangesinthebrain.Schoolsshouldaddmusicclasses,notcutthem.Nearly20yearsago,a
最新回复
(
0
)