4.可以定义点类(Point),再定义一个类(Distance)描述两点之间的距离,其数据成员为两个点类对象,两点
人气:362 ℃ 时间:2020-06-19 07:11:31
解答
class Point{public:Point(double x=0,double y=0):x(x),y(y){}void setData(double x0,double y0){x=x0;y=y0;}double getX(){return x;}double getY(){return y;}double Distance(Point t){return sqrt((x-t.getX()...
推荐
猜你喜欢
- 如何防止过饱和葡萄糖溶液结晶
- y=根号2x-3+根号3-2x+7求x+y的值
- k/v1-k/v2=k×v2-v1/v1v2
- 解关于x的不等式m(x+2)
- 一个梯形的上底10cm,把他的下底缩短6cm后,变成高是8cm的平行四边形,这个梯形的面积是( ).
- 初一上数学时代数学报用方程解决问题及本章小结答案
- 1.已知向量a,b的模都是3,其夹角为60°,当OP=根号10a+2b,OQ=-2a+根号10b,求P,Q两点间的距离.2.设函数f(x)=sinx+sin2x+3cosx.(1)将函数写成f(x)=Asin(wx+q)+k(A>0,w>0
- 饱和硅酸钠溶液与二氧化碳反应,为什么生成了白色胶状沉淀,硅酸不是白色粉末吗?