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

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

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

} else { if (seek(temp->name) != nullptr){ cout << \此人已存在于家谱中!\ << endl; } else{ cout << \按ENTER确定添加并返回菜单\\n 按ESC取消添加并返回菜单\; for (;;){ int j = _getch(); if (j == 27){ delete temp; break; } if (j == 13){ if (jubge->pson == nullptr) jubge->pson = temp; else{ Member *p = jubge->pson; while (p->pbro != nullptr) p = p->pbro; p->pbro = temp; } cout << \保存成功!\\n\; break; } } } } cout << \按ESC键返回菜单\; for (;;){ if (_getch() == 27) break; } return true; } bool FamilySystem::deleteMem(){ cout << \删除成员.\\n\\n\; cout << \请输入姓名:\; string na; try{ istringstream sin(gets()); sin >> na; } catch (int){ goto end; } Member *temp = seek(na); if (temp == nullptr) cout << \家谱中没有此人!\\n\\n\; else{ if (temp->pson != nullptr){ cout << \此人有后代!若删除此人其后代将同时被删!\; cout << \按ENTER继续\\n 按ESC退出\; for (;;){ int j = _getch(); if ( j== 27) return false; if (j == 13) break; } } Member *p = seek(temp->father); if (p == nullptr) root = nullptr; else if (temp == p->pson) p->pson = nullptr; else{ while (p->pbro!=temp){ p = p->pbro; } p->pbro = nullptr; } cout << \删除成功!\\n\\n\; } cout<<\按ESC键返回菜单\; for (;;){ if (_getch() == 27) break; } end:return true; } bool FamilySystem::demandMem(){ cout << \查询成员.\\n\\n\; cout << \请输入姓名:\; string na; try{ istringstream sin(gets()); sin >> na; } catch (int){ goto end; } Member *m=seek(na); if(m!=nullptr) cout << *m; else cout << \对不起,家谱中没有此人的信息!\\n\\n\; cout << \按ESC键返回菜单\; for (;;){ if (_getch() == 27) break; } end:return true; }

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