#include #include "person/base/Person.h" #include "person/students/Graduate.h" #include "person/TeachAssistant.h" int main() { /* * 因为这里的代码用到了中文,所以代码文件编码设置成了GBK,而不是UTF8(呜呜呜) * 所以请设置好编译器及控制台相关选项,以免运行时输出乱码 * 该项目为CMake项目,为运行方便建议使用VStudio或者clion等支持cmake的IDE打开本项目(已测试过) */ // to avoid garbled when output Chinese character // 防止中文乱码 setlocale(LC_ALL, "zh-CN"); Person baseInformation("id233333", "Lag Seeing", Person::SEX_MALE, "ident23333", Date(2002, 9, 6)); Person adviserBaseInformation("id0000000", "Goos Suede", Person::SEX_MALE, "ident000000", Date(1992, 1, 1)); Teacher adviser(adviserBaseInformation, "导师", "BEE-HIVE"); TeachAssistant teachAssistant(121, baseInformation, "不知道什么专业", adviser, "助教", "BEE-HIVE"); std::cout << teachAssistant.toString() << '\n'; std::cout << "\nover. If Chinese character can't be display correctly, please check the file encoding. (GBK)\n"; return 0; }