#include <iostream>
using namespace std;
class MyPoint {
public:
double x;
double y;
MyPoint() {
x = 0;
y = 0;
}
MyPoint(double x, double y) {
this->x = x;
this->y = y;
}
double getX() {
return x;
}
double getY() {
return y;
}
double distance(double x, double y) {
double s;
s = sqrt((this->x - x) * (this->x - x) + (this->y - y) * (this->y - y));
return s;
}
double distance(MyPoint mypoint) {
double s;
s = sqrt((this->x - mypoint.getX()) * (this->x - mypoint.getX()) + (this->y - mypoint.getY()) * (this->y - mypoint.getY()));
return s;
}
};
int main()
{
cout << "Author:Z.2022" << endl;
cout << "Running time:2021-11-26" << endl;
MyPoint m1(0,0);
MyPoint m2(10, 30.5);
cout << "The distance is " << m1.distance(m2) << endl;
}