using namespace std;
The class Complex {
Private:
Double r, I;
Public:
Complex (double a=0, double b=0) {
R=a;
I=b; }
Complex (Complex & amp; P) {
R=p.r;
I=p.i. }
//friend Complex operator - (const Complex & amp; , const Complex & amp;);
Friend, Complex & amp; Operator -=(Complex & amp; , const Complex & amp;);
Friend, Complex & amp; The operator *=(Complex & amp; , const Complex & amp;);
Friend, Complex & amp; The operator/=(Complex & amp; , const Complex & amp;);
Friend, Complex & amp; Operator + + (Complex & amp;);
Friend, Complex operator + + (Complex & amp; , int);
void show();
};
/* Complex operator - (const Complex & amp; A, const Complex & amp; B) {
Return Complex (a.r - b.r, Anderson - b.i); } */
Complex & amp; Operator -=(Complex & amp; A, const Complex & amp; B) {
A.r -=b.r;
Anderson -=b.i;
Return a; }
Complex & amp; The operator *=(Complex & amp; A, const Complex & amp; B) {
The Complex t;
T.r=b.r - Anderson, a.r * * b.i;
T.i=b.i + Anderson, a.r * * b.r;
a=t;
Return a; }
Complex & amp; The operator/=(Complex & amp; A, const Complex & amp; B) {
The Complex t;
T.r=(b.r + Anderson, a.r * * b.i)/(b.r + b.i b.r * * b.i);
T.i=(Anderson, * b.r a.r * b.i)/(b.r + b.i b.r * * b.i);
a=t;
Return a; }
Complex & amp; Operator + + (Complex & amp; P) {
+ + p.r.
+ + p.i.
return p; }
Complex operator + + (Complex & amp; P, int) {
Return Complex (p.i p.r + +, + +); }
Void Complex: : show () {
Cout<" (" & lt;
Complex a; Cout<" A: "; A.s how ();
Aiaa Complex b (9); Cout<" B: "; B.s how ();
Complex c=b; Cout<" C: "; C.s. how ();
//a=b - c;
Cout<" A=b - c: after "& lt;
A -=b;
Cout<" After a -=b: "& lt;
A *=c;
Cout<" After the a *=c: "& lt;
A/=c;
Cout<" After the a/c=: "& lt;
+ + a;
Cout<" After the + + a: "& lt;
Cout<" After the + : "& lt;
Cout<" A: "; A.s how ();
return 0;
}
Where the annotation is problematic, a small program on plural operation, don't know what is wrong, ask bosses know!!!!!!