第四章
努力爱上代码的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 · 219 阅读 · 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 · 252 阅读 · 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 · 239 阅读 · 1 评论 -
第四章第四题
#include using namespace std;class Matrix //定义Matrix类 {public:Matrix(); //默认构造函数 friend Matrix operator+(M原创 2015-04-24 14:15:30 · 215 阅读 · 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 · 164 阅读 · 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 · 192 阅读 · 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 · 234 阅读 · 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 · 223 阅读 · 0 评论