#include <iostream>
using namespace std;

class complex
{	
private:
	float _re,_im;
public:
	void wypisz()
	{cout << "re:"<<this->_re<<" im:"<<this->_im<<endl;}
	complex(float re=0.0,float im=0.0)
	{_re=re,_im=im;}
	friend complex operator+(complex,complex);
};

complex operator+(complex Z1,complex Z2)
{
	complex tmp;
	tmp._re=Z1._re+Z2._re;
	tmp._im=Z1._im+Z2._im;
	return tmp;
}

void main(void)
{
	complex Z1(1.0,2.0),Z2(3.0,4.0),Z3;
	Z3=Z1+Z2;
	Z3.wypisz();
}