#include "complex.h" Complex Complex::operator+(const Complex& d){ return Complex(re+d.re, im+d.im); } Complex Complex::operator-(const Complex& d){ return Complex(re-d.re, im-d.im); } Complex& Complex::operator+=(const Complex& d){ re+=d.re; im+=d.im; return *this; } std::ostream& operator<<(std::ostream& out, const Complex& z){ out << "(" << z.re << "," << z.im << ")"<< std::endl; return out; } std::istream& operator>>(std::istream& is, Complex& z){ is >> z.re >> z.im; return is; }