![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
第四章
文章平均质量分 53
letitbeme99
这个作者很懒,什么都没留下…
展开
-
定义一个复数类Complex 重载运算符 第二题
#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex operator-(Complex原创 2015-05-11 23:32:27 · 8375 阅读 · 1 评论 -
第六题
#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r){real=r;imag=0;} Complex(double r,double i){real=r;imag=i;} operator double(){retur原创 2015-05-11 23:40:07 · 663 阅读 · 0 评论 -
定义一个复数类Complex 第一题
#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} double get_real(); double get_imag(); void display();原创 2015-05-11 23:32:56 · 16081 阅读 · 2 评论 -
重载流插入运算符《和流提取运算符》 第五题
#include //using namespace std; class Matrix {public: Matrix(); friend Matrix operator+(Matrix &,Matrix &); friend ostream& operator<<(ostream&,Matrix&); friend istream& operator>原创 2015-05-11 23:38:21 · 1776 阅读 · 0 评论 -
定义一个教师类和一个学生类 第七题
#include using namespace std; class Student {public: Student(int,char[],char,float); int get_num(){return num;} char * get_name(){return name;} char get_sex(){return sex;} void disp原创 2015-05-11 23:39:26 · 3016 阅读 · 0 评论 -
定义一个复数类Coplex 使之能用于复数的加法运算 第三题
#include using namespace std; class Complex {public: Complex(){real=0;imag=0;} Complex(double r,double i){real=r;imag=i;} Complex operator+(Complex &c2); Complex ope原创 2015-05-11 23:35:33 · 1666 阅读 · 0 评论 -
有两个矩阵a和b 均为2行3列 求两个矩阵之和第四题
#include using namespace std; class Matrix //定义 Matrix 类 {public: Matrix(); //默认构造函数 friend Matrix oper原创 2015-05-11 23:37:13 · 18812 阅读 · 1 评论 -
保护继承方式 第五章第三题
#include using namespace std; class Student //声明基类 {public: //基类公用成员 void get_value(); void display( ); protected :原创 2015-05-17 23:21:36 · 528 阅读 · 0 评论