class Complex{ private: double real; double imag; public: Complex(){ real = 0; imag = 0; } Complex(double r, double i){ real = r; imag = i; } void Set(double r, double i){ real = r; imag = i; } void Show(){ cout<<real<<"+"<<imag<<"i"<<endl; } };

#includeiostreamusing namespace std;你提交的代码在这里int main Complex c1; coutShow object c1; c1Show; double realimag; cinrealimag; Complex c2realimag; coutShow object c2; c2Show; c

原文地址: http://www.cveoy.top/t/topic/gTXg 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录