文章
84
粉丝
408
获赞
33
访问
877.1k
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;
class CPoint{
private:
int x, y;
public:
CPoint(){}
CPoint(int xx, int yy):x(xx),y(yy){}
~CPoint(){}
double operator-(CPoint c);
};
double CPoint::operator-(CPoint c)
{
return sqrt((x-c.x)*(x-c.x) + (y-c.y)*(y-c.y));
}
int main()
{
int m;
cin >> m;
while (m--) {
int x, y;
cin >> x >> y;
CPoint a(x,y);
cin >> x >> y;
CPoint b(x,y);
double dis = a - b;
printf("%.2f\n", dis);
}
return 0;
}
登录后发布评论
暂无评论,来抢沙发