#include
#include
using namespace std;
class Point
{
double X,Y;
public:
Point(double a = 0,double b = 0);
double GetX();
double GetY();
friend double GetLength( Point &A,Point &B);
};
double GetLength( Point &A,Point &B)
{
double a = A.X - B.X;
double b = A.Y - B.Y;
return static_cast(sqrt(aa+bb)) ;
}
int main(){
Point P1(4,5),P2(1,1);
cout<<“两点之间的距离为:”<<GetLength(P1,P2)<<endl;
return 0;
}
有大佬看看哪有问题吗c++
最新推荐文章于 2023-03-14 15:09:08 发布