#include <iostream>
#include <cmath>
class Point {
private:
int _x;
int _y;
public:
Point(int x, int y) {
this->_x = x;
this->_y = y;
}
double getDistance(Point* p) {
return sqrt(pow(this->_x - p->_x, 2) + pow(this->_y - p->_y, 2));
}
};
int main() {
Point* a = new Point(0, 0);
Point* b = new Point(10, 10);
std::cout << a->getDistance(b) << std::endl;
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8Y21hdGg+CiAKY2xhc3MgUG9pbnQgewoJcHJpdmF0ZToKCQlpbnQgX3g7CgkJaW50IF95OwogCglwdWJsaWM6CgkJUG9pbnQoaW50IHgsIGludCB5KSB7CgkJCXRoaXMtPl94ID0geDsKCQkJdGhpcy0+X3kgPSB5OwoJCX0KIAoJCWRvdWJsZSBnZXREaXN0YW5jZShQb2ludCogcCkgewoJCQlyZXR1cm4gc3FydChwb3codGhpcy0+X3ggLSBwLT5feCwgMikgKyBwb3codGhpcy0+X3kgLSBwLT5feSwgMikpOwoJCX0KfTsKIAppbnQgbWFpbigpIHsKCVBvaW50KiBhID0gbmV3IFBvaW50KDAsIDApOwoJUG9pbnQqIGIgPSBuZXcgUG9pbnQoMTAsIDEwKTsKIAoJc3RkOjpjb3V0IDw8IGEtPmdldERpc3RhbmNlKGIpIDw8IHN0ZDo6ZW5kbDsKIAoJcmV0dXJuIDA7Cn0=