第一范文网 - 专业文章范例文档资料分享平台

数据结构大作业之家谱管理系统

来源:用户分享 时间:2025/7/21 7:36:52 本文由loading 分享 下载这篇文档手机版
说明:文章内容仅供预览,部分内容可能不全,需要完整文档或者需要复制内容,请下载word后使用。下载word有问题请添加微信号:xxxxxxx或QQ:xxxxxx 处理(尽可能给您提供完整文档),感谢您的支持与谅解。

ostream &operator<<(ostream &out, const Member

&m){ out << endl << setw(25) << \该成员信息如下:\ << endl <>(istream &in, Member &m){ in >> m.name >> m.birthPlace >> m.birthDay >> m.sex >> m.height >> m.age >> m.education >> m.job >> m.father; return in; } //FamilySystem的成员函数 int FamilySystem::menu(){ cout << \; cout << \---------------------------\\n\; cout << \|\\n\; cout << \系统菜单 |\\n\; cout << \|\\n\; cout << \查询成员 |\\n\; cout << \|\\n\; cout << \查询家庭整体情况 |\\n\; cout << \|\\n\; cout << \添加成员 |\\n\; cout << \|\\n\; cout << \删除

成员 |\\n\; cout << \|\\n\; cout << \修改成员信息 |\\n\; cout << \|\\n\; cout << \显示整个家谱 |\\n\; cout << \|\\n\; cout << \按ESC退出系统 |\\n\; cout << \|\\n\; cout << \---------------------------\\n\; cout << \; int n = 0; while (1){ n = _getch(); if (n == 27) break; if (n >= 49 &&n<=54) break; cout << \请按下1、2、3、4、5、6选择或按ESC键退出!\ << endl; } return n; } bool FamilySystem::fileInit(){ ifstream infile; //打开存储成员信息的文件,读入成员信息 infile.open(\, ios::in | ios::_Nocreate); if (!infile){ return false; } vector genely;//保存这一代成员的指针 vector next;//保存下一代成员的指针 Member *temp = new Member;//临时保存输入的成员信息 root = temp;//第一个赋给root genely.push_back(root); next.push_back(root); while (infile >> *temp){ //将成员放入家族树中,成员的父亲必须是这一代的成员 for (auto i = genely.begin(); i != genely.end(); ++i){ if ((*i)->name == temp->father){ if ((*i)->pson==nullptr) (*i)->pson = temp; else{

搜索更多关于: 数据结构大作业之家谱管理系统 的文档
数据结构大作业之家谱管理系统.doc 将本文的Word文档下载到电脑,方便复制、编辑、收藏和打印
本文链接:https://www.diyifanwen.net/c2tkvx2c7s51jxut0i32m_3.html(转载请注明文章来源)
热门推荐
Copyright © 2012-2023 第一范文网 版权所有 免责声明 | 联系我们
声明 :本网站尊重并保护知识产权,根据《信息网络传播权保护条例》,如果我们转载的作品侵犯了您的权利,请在一个月内通知我们,我们会及时删除。
客服QQ:xxxxxx 邮箱:xxxxxx@qq.com
渝ICP备2023013149号
Top