#include <iostream>
#include <conio.h>
#include <cstdio>
#include <cstdlib>
using namespace std;
class zb {
public:
zb() {
}
zb operator+(const zb& t);
zb(int m,int n){
x = m;
y = n;
}
~zb() {
}
void show() {
cout << "x=" << x << "y=" << y << endl;
}
private:
int x;
int y;
};
zb zb::operator+(const zb& t) {//重载+号;
zb temp;
temp.x = this->x + t.x;
temp.y = this->y + t.y;
return temp;
}
int main()
{
zb c1(1, 2);
zb c2(2, 4);
zb c3;
c3 = c1 + c2;//重载+号的使用;
c3.show();//
return 0;
}