c/c++课的作业合集,都是很简单的文件。
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
533 B

#include <sstream>
#include "Teacher.h"
Teacher::Teacher(const Person &person, const std::string &job, const std::string &department) :
Person(person), job(job), department(department) {}
Teacher::Teacher(const Teacher &teacher) : department(teacher.department), job(teacher.job), Person(teacher) {}
std::string Teacher::toString() {
std::stringstream output;
output << Person::toString() + '\n'
<< "<EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>" << department << '\n'
<< "ְ<EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << job;
return output.str();
}