#include<iostream>
#include<string>
#include<math.h>
using namespace std;
class Location{
public:
Location(double a,double b)
{
x=a;
y=b;
}
double Getx()
{
return x;
}
double Gety()
{
return y;
}
double distance1 (Location&C)
{
int d1;
d1=sqrt((x-C.Getx())*(x-C.Getx())+(y-C.Gety())*(y-C.Gety()));
cout<<"Distance1="<<d1<<endl;
return 0;
}
friend double distance2(Location &,Location &);
private:
double x,y;
};
double distance2(Location &C,Location &D)
{
int d2;
d2=sqrt((C.Getx()-D.Getx())*(C.Getx()-D.Getx())+(C.Gety()-D.Gety())*(C.Gety()-D.Gety()));
cout<<"distance2="<<d2<<endl;;
return 0;
}
int main()
{
Location A(-3,15);
Location B(-3,6);
cout<<"A("<<A.Getx()<<","<<A.Gety()<<") B("<<B.Getx()<<","<<B.Gety()<<")"<<endl;
A.distance1(B);
distance2(A,B);
return 0;
}