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.

23 lines
836 B

#include <iostream>
#include <sstream>
#include "Person.h"
Person::Person(const std::string& id, const std::string &name, char sex, const std::string &identNumber,
const Date &birthday) : id(id), name(name), sex(sex), identNumber(identNumber), birthday(birthday) {}
Person::Person(const Person &person) : id(person.id), name(person.name), sex(person.sex),
identNumber(person.identNumber),
birthday(person.birthday) {}
std::string Person::toString() {
std::stringstream output;
output
<< "<EFBFBD><EFBFBD><EFBFBD>ţ<EFBFBD>" << id << '\n'
<< "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>" << name << '\n'
<< "<EFBFBD>Ա<EFBFBD><EFBFBD><EFBFBD>" << sex << '\n'
<< "<EFBFBD><EFBFBD><EFBFBD><EFBFBD>֤<EFBFBD>ţ<EFBFBD>" << identNumber << '\n'
<< "<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ڣ<EFBFBD>" << birthday.toString();
return output.str();
}