![](https://img-blog.csdnimg.cn/20201014180756754.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
第四章
努力爱上代码的boy
这个作者很懒,什么都没留下…
展开
-
第四章第一题
#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-04-24 14:11:48 · 223 阅读 · 0 评论 -
第四章第二题
#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-04-24 14:12:10 · 257 阅读 · 0 评论 -
第四章第三题
#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 opera原创 2015-04-24 14:14:01 · 248 阅读 · 1 评论 -
第四章第四题
#include using namespace std;class Matrix //定义Matrix类 {public:Matrix(); //默认构造函数 friend Matrix operator+(M原创 2015-04-24 14:15:30 · 221 阅读 · 0 评论 -
第四章第五题
#include >using namespace std;class Matrix {public: Matrix(); friend Matrix operator+(Matrix &,Matrix &); friend ostream& operator friend istream& operator>>(istream&,Matrix&);原创 2015-04-27 12:27:49 · 166 阅读 · 0 评论 -
第四章第六题
#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-04-27 12:30:21 · 196 阅读 · 0 评论 -
第四章第七题
#include using namespace std;#include "string.h"class Student{public:Student(int,char[],char,float); int get_num(){return num;} char * get_name(){return name;} char get_sex(){return原创 2015-04-27 12:34:56 · 237 阅读 · 0 评论 -
用重载运算符做String
#ifndef _STRING_#define _STRING_#include "iostream"using std::ostream;using std::istream;class String{private:char *s;public:String();String(int n);String(const原创 2015-04-27 17:28:22 · 227 阅读 · 0 评论