X=xx,#include#includeusing namespace std;class point {public:point(int xx=0,int yy=0) {X=xx;Y=yy;}int getX() {return X;}int getY() {return Y;}friend float fdist(point &a,point &b);private:int X,Y;};float fdist(point &p1,point &p2){double x=double(p1.
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/15 15:27:35
X=xx,#include#includeusing namespace std;class point {public:point(int xx=0,int yy=0) {X=xx;Y=yy;}int getX() {return X;}int getY() {return Y;}friend float fdist(point &a,point &b);private:int X,Y;};float fdist(point &p1,point &p2){double x=double(p1.
X=xx,
#include
#include
using namespace std;
class point
{
public:
point(int xx=0,int yy=0) {X=xx;Y=yy;}
int getX() {return X;}
int getY() {return Y;}
friend float fdist(point &a,point &b);
private:
int X,Y;};
float fdist(point &p1,point &p2)
{double x=double(p1.X-p2.X);
double y=double(p1.Y-p2.Y);
return float (sqrt(x*x+y*y));
}
void main(){point myp1(1,1),myp2(4,5);
cout
X=xx,#include#includeusing namespace std;class point {public:point(int xx=0,int yy=0) {X=xx;Y=yy;}int getX() {return X;}int getY() {return Y;}friend float fdist(point &a,point &b);private:int X,Y;};float fdist(point &p1,point &p2){double x=double(p1.
xx,yy是作为一个变量,是个整体的,不能分开,程序中没有x或y,单写一个程序会出错,X=xx,Y=yy是赋值语句,就是把xx的值赋给X,yy的值赋给Y