#include <iostream>
#include"math.h"
using namespace std;
class Cpoint
{
private:
double x;
double y;
public:
Cpoint(double xx=0,double yy=0):x(xx),y(yy){}
void distance1(Cpoint &p1,Cpoint &p2);
friend void distance2(Cpoint &p1,Cpoint &p2);
int getx()
{
return x;
}
int gety()
{
return y;
}
};
void Cpoint::distance1(Cpoint &p1,Cpoint &p2)
{
double s;
s=sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
cout<<s<<endl;
}
void distance2(Cpoint &p1,Cpoint &p2)
{
double s;
s=sqrt((p1.x-p2.x)*(p1.x-p2.x)+(p1.y-p2.y)*(p1.y-p2.y));
cout<<s<<endl;
}
void distance3(Cpoint &p1,Cpoint &p2)
{
double s;
s=sqrt((p1.getx()-p2.getx())*(p1.getx()-p2.getx())+(p1.gety()-p2.gety())*(p1.gety()-p2.gety()));
cout<<s<<endl;
}
int main()
{
Cpoint p1(0,0),p2(1,1);
p1.distance1(p1,p2);
distance2(p1,p2);
distance3(p1,p2);
return 0;
}