![](https://img-blog.csdnimg.cn/20201014180756926.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
C++面向对象程序设计(谭浩强)部分题目答案
6ev
这个作者很懒,什么都没留下…
展开
-
第4章 Teacher和Student 数据移植
#include<iostream> #include<string> using namespace std; class Student; class Teacher{ public: Teacher(int n,string str,char s):num(n),name(str),sex(s){ } void trans(Student &); ...原创 2018-06-22 19:44:44 · 369 阅读 · 0 评论 -
第4章 重载运算符 * 作复数乘法运算
#include<iostream> using namespace std; class Complex{ public: Complex(){real = 0;imag = 0;} Complex(double r,double i){real = r;imag = i;} friend Complex operator * (Complex &c1,Com...原创 2018-06-18 10:10:10 · 928 阅读 · 0 评论 -
第4章 重载运算符 / 作复数除法运算
#include<iostream> #include<math.h> using namespace std; class Complex{ public: Complex(){real = 0;imag = 0;} Complex(double r,double i){real = r;imag = i;} friend Complex operator...原创 2018-06-18 10:29:31 · 579 阅读 · 0 评论