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.
 
 
 

22 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
<< "编号:" << id << '\n'
<< "姓名:" << name << '\n'
<< "性别:" << sex << '\n'
<< "身份证号:" << identNumber << '\n'
<< "出生日期:" << birthday.toString();
return output.str();
}