这道C++编程题怎么做啊啊,如图,跪求大神在线解答,挺急的

2024-12-01 17:28:32
推荐回答(1个)
回答1:

class Imaginary{
public:
Imaginary(double c,double d)
:real(c),imag(d)
{};
Imaginary add(Imaginary,Imaginary);
//其他参照add写
private:
double real;
double imag;

Imaginary::add(Imaginary a,Imaginary b){
return Imaginary(a.real+b.real,a.imag+b.imag);