# include <iostream>
using namespace std;

class Complex
{
	private:
		double real,imag;
	public:
		Complex(double r=0.0,double i=0.0);
		double	getReal() const;
		double	getImag() const;
		void	printComplex();
		int sameComplex(Complex other);
		Complex	operator+(const Complex &other);
		Complex	operator-(const Complex &other);
};
int Complex::sameComplex(Complex other)
{
	if(this->getReal()==other.getReal() && 
		this->getImag()==other.getImag() ) 
		return 1;
    else
		return 0;
}


Complex::Complex(double real,double imag)
{
	this->real=real;
	this->imag=imag;
}

Complex	Complex::operator+(const Complex &other)
{
	return Complex(this->getReal()+other.getReal(),
			this->getImag()+other.getImag());
}

Complex	Complex::operator-(const Complex &other)
{
	return Complex(this->getReal()-other.getReal(),
			this->getImag()-other.getImag());
}

double	Complex::getReal() const
{
	return real;
}

double	Complex::getImag() const
{
	return imag;
}

void	Complex::printComplex()
{
	cout<<real<<"+"<<imag<<"i"<<endl;
}

int main()
{
	Complex c1(10,20);
	Complex c2(10,40);
	
	Complex c3=c1+c2;
	c3.printComplex();
	return 0;
}
