
作业社区
探索学习新天地,共享知识资源!
大禹123 的学生作业:
Computer.h #ifndef __COMPUTER_EHADER_H #define __COMPUTER_EHADER_H #include using namespace std; class Computer { public: Computer(const string &brandname); ~Computer(); string getBrandName(void) const { return brandname; } private: string brandname; }; #endif Computer.cpp #include "Computer.h" Computer::Computer(const string &brandname):brandname(brandname) { cout





大禹123 的学生作业:
Hero.h #ifndef _HEARO_HEAD_H #define _HEARO_HEAD_H #include using namespace std; class Hero { public: Hero(const string &name = "hello"); ~Hero(); void skill(void) const; string getName(void) const { return this->name; } private: string name; }; #endif Hero.cpp #include "Hero.h" Hero::Hero(const string &name) { cout




