这道C++编程题怎么做啊啊,如图,跪求大神在线解答,挺急的
1个回答
2018-12-10
展开全部
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);
}
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);
}
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询