// test_day11.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream.h>
#include <math.h>
class CPoint{
public :
CPoint(double a,double b,double c,double d):x(a-c),y(b-d){
z=sqrt(x*x+y*y);
}
void getCPoint() const{
cout<<"您输入的两个点的距离是:"<<z<<endl;
}
private :
double x;
double y;
double z;
};
class Length{
public:
Length(double a,double b,double c,double d):ct(a,b,c,d)
{
ct. getCPoint();
}
private:
CPoint ct;
};
int main(int argc, char* argv[])
{
double a,b,c,d;
cout<<"请输入两个点的坐标"<<endl;
cin>>a>>b>>c>>d;
Length l(a,b,c,d);
return 0;
}