下面是一个类complex,并定义了运算符+的重载函数原型,要求补上完整而正确的函数class complex{\x09double real,imag;public:\x09\x09complex(double r,double i){real=r;imag=i;}\x09\x09friend complex operator+(complex a,complex b
来源:学生作业帮助网 编辑:作业帮 时间:2024/11/27 17:52:52
x){EfɎU7N-Iysu| MfY-/{_}ﳩ:[Ųg^,\dGu=Ϧnyl5@&$+@M0L/MIU(JMML. 3@r USedjVYtfZte,Q/H-J,/ր$XI6IEt>:0 `44l҃E)i,?3E(3DC:9Ff'₲EmIjn$pA,=SvB;0L%((ɨZ<;P +
下面是一个类complex,并定义了运算符+的重载函数原型,要求补上完整而正确的函数class complex{\x09double real,imag;public:\x09\x09complex(double r,double i){real=r;imag=i;}\x09\x09friend complex operator+(complex a,complex b
下面是一个类complex,并定义了运算符+的重载函数原型,要求补上完整而正确的函数
class complex
{\x09double real,imag;
public:
\x09\x09complex(double r,double i){real=r;imag=i;}
\x09\x09friend complex operator+(complex a,complex b);
\x09\x09void print(){cout
下面是一个类complex,并定义了运算符+的重载函数原型,要求补上完整而正确的函数class complex{\x09double real,imag;public:\x09\x09complex(double r,double i){real=r;imag=i;}\x09\x09friend complex operator+(complex a,complex b
complex operator+(complex a,complex b){
complex temp;
temp.real=a.real+b.real;
temp.imag=a.imag+b.imag;
return temp;
}