有以下程序; #include<iostream> usingnamespacestd; classComplex { public: Complex(doubler=0,doublei=O):re(r),im(i){} doublereal()const{returnre;} doubleimag()const{returnim;} Complexoperator+(Complexc)const {returnComplex(re+C.re,im+C.im);} private: doublere,im; }; intmain() { Complexa=Complex(1,1)+Complex(5); cout<<a.real()<<+<<a.imag()<<i<<endl; return0; } 程序执行后的输出结果是( )。
免费的网站请分享给朋友吧