定义一个实数类real,类中包括一个数据成员real,构造函数、display()函数以及重载的+、-、*、/
定义一个实数类real,类中包括一个数据成员real,构造函数、display()函数以及重载的+、-、*、/
日期:2016-03-31 21:11:15 人气:1
#include
using namespace std;
class CComplex
{
public:
CComplex(double, double);
CComplex(CComplex &c); //复数类的拷贝构造函数声明
double GetReal();
double GetImag();
void Print();
private:
double real;
double imag;
};
CComplex::CComplex