首页
外语
计算机
考研
公务员
职业资格
财经
工程
司法
医学
专升本
自考
实用职业技能
登录
计算机
下面程序的输出结果是【 】。 #inclde<iostreamn> #include<math> using namespace std; class point { private: double x;
下面程序的输出结果是【 】。 #inclde<iostreamn> #include<math> using namespace std; class point { private: double x;
admin
2009-01-15
95
问题
下面程序的输出结果是【 】。
#inclde<iostreamn>
#include<math>
using namespace std;
class point
{
private:
double x;
double y;
public:
point(double a,double b)
{
x=a;
y=b;
}
friend double distance(point a,point b);
};
double distance(point a,point b)
{
return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
int main()
{
point p1(1,2);
point p2(5,2);
cout<<distalice(p1,p2)<<endl;
return 0;
}
选项
答案
4
解析
转载请注明原文地址:https://kaotiyun.com/show/ZSkp777K
本试题收录于:
二级C题库NCRE全国计算机二级分类
0
二级C
NCRE全国计算机二级
相关试题推荐
以下关于结构化程序设计的叙述中正确的是
有以下程序#includevoidfun(char*p){++p;printf("%s\n",*p);)main(){char*a[]=("Morning","Afternoon","Evening","Night");fun(a);}程
设有定义doublea[10],*s=a;以下能够代表数组元素a[3]的是
有以下程序#include<stdio.h>voidmain(){chars[]={"012xy"};inti,n=0;for(i=0;s[i]!=0:i++)if(s[i]>=’a’&&s[i]<=’Z’)n++;printf("%d\
有以下程序,程序运行后的输出结果是#includemain(){intx,y,z;x=y=1;z=x++,y++,++y;printf("%d,%d,%d\n",x,y,z);}
有以下程序:#includeintf(intx,inty){return((y-x)*x);}main(){inta=3,b=4,c=5,d;d=f(f(a,b),f(a,c));printf("%d\n",d);}程序运行后的输出结果是
若有定义语句intb=2;则表达式(b
运算符重载是对已有的运算符赋予多重含义,因此()。
数据库系统阶段的数据具有较高独立性,数据独立性包括物理独立性和【】两个含义。
随机试题
在前臂前群肌中起点于肱骨内上髁的有()
关于脾和淋巴结的共同点,哪项错误()
脑脊液的产生和循环径。
矫治力不来源于A.各种金属丝变形后的回弹力B.弹性材料拉长后的回缩力C.永磁材料异性相吸D.咬合的力量E.矫治器本身的重力
龙山石窟是现存()中规模最大的一处。
我国陶器生产向瓷器生产的过渡是在()时期。
关于询问证人说法错误的是()。
如果一个人的性格表现为整洁、小气、做事有条理,则按照弗洛伊德的人格理论,此人的性格为()。
Clothesplayacriticalpartintheconclusionswereachbyprovidingcluestowhopeopleare,whotheyarenot,andwhotheywo
A、Billisveryoldnow.B、Thespeakersareoldfriends.C、Thewomanisinvitedtodinner.D、Thespeakersarelateforwork.BW:
最新回复
(
0
)