类方法实现复数加减运算

来源:学生作业帮助网 编辑:作业帮 时间:2024/05/07 18:25:10
类方法实现复数加减运算

类方法实现复数加减运算
类方法实现复数加减运算

类方法实现复数加减运算
#include
#include
using namespace std;
class complex
{
public:
complex(){real=0;imag=0;}
complex(double r,double i){real=r;imag=i;}
complex operator+(complex &c);
complex operator-(complex &c);
void display()
{cout