#include using namespace std; class Complex { public: double real; double imag; Complex(double r = 0, double i = 0); void print(); Complex operator+(Complex c); Complex operator*(Complex c); }; Complex::Complex(double r, double i) { real = r; imag = i; } Complex Complex::operator+(Complex c) { Complex temp; temp.real = real + c.real; temp.imag = imag + c.imag; return temp; } Complex Complex::operator*(Complex c) { Co
【无标题】最先出现在Python成神之路。
共有 0 条评论