include
#include
using namespace std;
class Point
{
public:
Point(int a,int b):x(a),y(b){cout<<"初始化点类的一个对象\n";}
~Point(){cout<<"回收点类的内存空间\n";}
void show(){cout<<"这个点的坐标为:"<<"("< double distance(Point &p){return sqrt((p.y-y)*(p.x-y)+(p.x-x)*(p.x-x));}
private:
int x;
int y;
};
int main()
{
Point a(0,0);
Point b(1,1);
cout< return 0;
}
随便给你写了个,友元函数什么的估计你也没学,估计你刚学到
类和对象