class Complex{
public:
double real;
double imag;
Complex(double r=0.0,double i=0.0):real(r),imag(i){}
};
Complex operator+(Complex co1,Complex co2)
{
return Complex(co1.real+co2.real,co1.imag+co2.imag);
}
class Complex{
public:
Complex(double r=0.0,double i=0.0):real(r),imag(i){}
Complex operator+(Complex c);
private:
double real;
double imag;
};
Complex Complex::operator+(Complex c)
{
return Complex(real+c.real,imag+c.imag);
}
class Complex{
public:
Complex(double r=0.0,double i=0.0):real(r),imag(i){}
friend Complex operator+(Complex& a,Complex& b);
private:
double real;
double imag;
};
Complex operator+(Complex& a,Complex& b)
{
return Complex(a.real+b.real,a.imag+b.imag);
}