//#include "stdafx.h"//If the vc++6.0, with this line.
#include
#include "math.h"
using namespace std;
class CPoint{
public:
double x,y;
friend double GetD(CPoint a,CPoint b);
};
double GetD(CPoint a,CPoint b){
return sqrt((a.x-b.x)*(a.x-b.x)+(a.y-b.y)*(a.y-b.y));
}
int main(int argc,char *argv[]){
CPoint t1,t2;
cout << "Please enter the coordinates of point 1:";
cin >> t1.x >> t1.y;
cout << "Please enter the coordinates of point 2:";
cin >> t2.x >> t2.y;
cout << "The distance=" << GetD(t1,t2) << endl;
return 0;
}