#include<iostream.h>
class Point
{
private:
int x;
int y;
friend class Line
public:
Point(int a,int b)
{x=a;
y=b;}
Point(Point &p)
{x=p.x;
y=p.y;
cout <<"vvvvvv"<<endl;}};
class Line
{private :
Point s;
Point e;
public :
Line (Point &p1,Point &p2):s(p1),e(p2)
{cout<<"("<<p1.x<<","<<p1.y<<")"<<endl;
cout<<"("<<p1.x<<","<<p1.y<<")"<<endl}
};
void main()
{Point p1(1,2);
Point p2(2,3);
Line l1(p1,p2);}
提示p2不能有两个值
class Point
{
private:
int x;
int y;
friend class Line
public:
Point(int a,int b)
{x=a;
y=b;}
Point(Point &p)
{x=p.x;
y=p.y;
cout <<"vvvvvv"<<endl;}};
class Line
{private :
Point s;
Point e;
public :
Line (Point &p1,Point &p2):s(p1),e(p2)
{cout<<"("<<p1.x<<","<<p1.y<<")"<<endl;
cout<<"("<<p1.x<<","<<p1.y<<")"<<endl}
};
void main()
{Point p1(1,2);
Point p2(2,3);
Line l1(p1,p2);}
提示p2不能有两个值