C++小型复数计算器.doc

#includeiostream #includecmath #includecstdlib #includecstring #includefstream #includectime #define EPS 1e-5 //定义精度常数 using namespace std; //使用标准空间命名std namespace NameCComplex //定义命名空间NameCComplex { class CComplex ////定义一个CComplex类 { private: double Real,Image; public: CComplex(double real=0,double image=0) //构造函数 { Real=real; Image=image; } friend istream operator(istream is,CComplex com); //重载输入 friend ostream operator(ostream os,CComplex com); //重载输出 CComplex operator+(CComplex com); //加法重载 CComplex operator-(CComplex com); //减法重载 CComplex operator*(CComplex com); //乘法重载 CComplex opera

文档评论(0)

1亿VIP精品文档

相关文档