#include #include #define ESP 1e-6 using namespace std; class comp { float Re, Im; public: comp() {} comp& operator = (const comp &x) { Re = x.Re; Im = x.Im; return *this; } comp& operator -= (const comp &x) { Re -= x.Re; Im -= x.Im; return *this; } friend comp operator + (const comp &a, const comp &b); bool operator == (const comp &x) { return(this -> Re == x.Re && this -> Im == x.Im); } void set(char s) { cout<<"Enter comp numb "<>Re; cout<<"\tIm: "; cin>>Im; return; } void get(char s); }; int main () { comp a, b, c; a.set('a'); b.set('b'); cout<<"operator -="< ESP; } void comp :: get(char s) { cout <<"comp numb "< 0) { cout<<" + "; } if(Im < 0) { cout<<" - "; } cout << abs(Im)<<"i"; } cout <