#include <math.h>
#include <iostream>
using namespace std;
class changdu
{
public:
changdu()
{
x1=0;
x2=0;
y1=0;
y2=0;
};
void juli(int x1,int x2,int y1,int y2);//
void juli(double x1,double x2,double y1,double y2);
private:
int x1;
int x2;
int y1;
int y2;
};
void changdu::juli(int x1,int x2,int y1,int y2)//
{
sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
cout<<sqrt<<endl;
}
void changdu::juli(double x1,double x2,double y1,double y2)
{
sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
cout<<sqrt<<endl;
}
int main()
{
changdu c1;
changdu c2;
c1.juli(1,3,1,3);
c2.juli(1.5,2.5,1.5,2.5);
}
习惯受伤
onemoo
相关分类