#include<iostream>usingnamespace std;classPoint{// friend Point add(const Point &, const Point &);friendclassMath;private:int m_x;int m_y;public:intgetX()const{returnthis->m_x;};intgetY()const{returnthis->m_y;};Point(int x,int y):m_x(x),m_y(y){}};classMath{public:
Point add(const Point &point1,const Point &point2){returnPoint(point1.m_x + point2.m_x, point1.m_y + point2.m_y);}};//Point add(const Point &point1, const Point &point2) {// return Point(point1.m_x + point2.m_x, point1.m_y + point2.m_y);//}intmain(){
Point point1(10,20);
Point point2(20,30);
Point point =add(point1, point2);
cout << endl;getchar();return0;}