摘要:
Person.hpp #ifndef PERSON_HPP #define PERSON_HPP #include<iostream> #include<fstream> using namespace std; class person{ private: string name; string 阅读全文
摘要:
task2运行结果为: 总结: (1)同名覆盖原则:子类和父类的名字必须相同,不然不叫覆盖。如果覆盖类容不报错,说明已经实现。方法的覆盖,这时子类和父类的名字必须相同。 (2)二元作用域在不同的地方有不同的含义,如果成员函数中定义了类与域中的变量同名的变量,则类域中的变量被块作用域中的变量隐藏。这时 阅读全文
摘要:
Vector.h #ifndef MATRIX_H #define MATRIX_H #include<iostream> using namespace std; class Matrix { public: Matrix(int n);//构造函数,构造一个n*n的矩阵 Matrix(int n 阅读全文
摘要:
info.h #ifndef INFO_HPP #define INFO_HPP #include<iostream> #include<algorithm> using namespace std; class Info{ private: string nickname; string cont 阅读全文
摘要:
#ifndef EMPLOYEE_HPP #define EMPLOYEE_HPP #include<iostream> #include<math.h> using namespace std; class Complex { public: ~Complex(); Complex(float a 阅读全文