题目内容
#include using namespace std;class Complex{public:Complex( ){real=0;imag=0;}Complex(double r, double i){real=r;imag=i;}Complex add(Complex c2) ;private:double real; //实部double imag; //虚部};Complex Complex:: add(Complex c2){ Complex temp;temp.real=this->real+c2.real;temp.imag=this->imag+c2.imag;return temp;}int main(){ Complex c1(3,4),c2(5, -10);Complex c3;____________________________//c3为c1与c2的和。return 0;}
查看答案
搜索结果不匹配?点我反馈
更多问题