文件名称:面向对象程序设计C++
文件大小:73KB
文件格式:DOC
更新时间:2013-01-31 13:47:24
综合报告
C++综合实验 实验内容 设计复数类,重载+,-,*,/,<<,>>等运算符。编程设计实现下列函数: MyComplex(); MyComplex(int a); MyComplex(int a,int b) ; MyComplex(const MyComplex& v) ; Mycomplex& operator=(const Mycomplex& rhs); Mycomplex& operator+=(const Mycomplex& rhs); Mycomplex& operator-=(const Mycomplex& rhs); Mycomplex& operator*=(const Mycomplex& rhs); Mycomplex& operator/=(const Mycomplex& rhs); friend MyComplex operator+(MyComplex m,MyComplex n) ; friend MyComplex operator-(MyComplex m,MyComplex n) ; friend MyComplex operator*(MyComplex m,MyComplex n) ; friend MyComplex operator/(MyComplex m,MyComplex n) ; friend ostream& operator<<(ostream& s,MyComplex t); friend istream& operator>>(istream& s,MyComplex& t);