Complex operator-(const Complex &f1,const Complex &f2)
{
return Complex(f1.real-f2.real,f1.image-f2.image);
}
Complex & Complex::operator-=(const Complex &f)
{
real=real-f.real;
image=image-f.image;
return *this;
}
ostream& operator<<(std::ostream& out,const Complex & f)
{
if(f.getImage() >0)
{
out<<f.getReal()<<"+"<<f.getImage()<<"i";
return out;
}
else if(f.getImage()<0)
{
out<<f.getReal()<<f.getImage()<<"i";
return out;
}
else
{
out<<f.getReal()<<endl;
return out;
}
}