//
// Created by 刘彪 on 2020/2/29.
//
//逗号运算符重载 p139 todo 编译失败
#include <iostream>
#include <cstdio>
#include <malloc.h>
using namespace std;
class Point{
int x,y;
public:
Point(){}
Point(int l,int w){
x = l;
y = w;
}
void disp(){
cout << "面积:"<<x*y<<endl;
}
Point operator,(Point r){
Point temp;
temp.x = r.x;
temp.y = r.y;
return temp;
}
Point operator+=(Point r){
Point temp;
temp.x = r.x+x;
temp.y = r.y+y;
return temp;
}
};
int main(){
Point r1(3,3),r2(5,8),r3(2,4);
r1.disp();
r2.disp();
r3.disp();
r1 = (r1,r2,r3);
r1.disp();
return 0;
}