> 数学 >
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()...
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版