云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > 数据结构大作业之家谱管理系统

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

  • 62 次阅读
  • 3 次下载
  • 2025/7/15 9:54:00

#include #include #include #include #include #include\ using std::cin; using std::cout; using std::endl; using std::setw; using std::vector; using std::ios; using std::ifstream; using std::ofstream; using std::istringstream; string gets(){//从控制台获取字符等信息 string s; while (int n = _getch()){ if (n == 27){ throw 27; break; } else if (n == 13){ cout << endl; break; } else if (n == 8){ s.pop_back(); cout << \; } else{ cout << char(n); s.push_back(char(n)); } } return s; } //与BirthDay相关的函数 istream &operator>>(istream &in, BirthDay &b){//从文件中读取生日的信息 in >> b.year >> b.month >> b.day; return in; } ostream &operator<<(ostream &out, BirthDay &b){ out << b.year << \ << b.month << \ << b.day; return out; } //与Member相关的函数 void Member::setE(){ try{ istringstream sin; cout << setw(20) << \请输入成员信息:\\n\ << endl << setw(20) << \姓名:\; sin.str(gets()); sin >> name; cout << endl << setw(20) << \出生地:\;

sin.str(gets()); sin.clear(); sin >> birthPlace; cout << endl << setw(20) << \生日:\; sin.str(gets()); while (true){ sin.clear(); sin >> birthDay.year >> birthDay.month >> birthDay.day; if ( !sin||birthDay.year > 2014 || birthDay.month > 12 || birthDay.day > 31){ cout << \输入错误,请重新输入:\; sin.str(gets()); } else break; } cout << endl << setw(20) << \性别:\; sin.str(gets()); sin.clear(); while (sin >> sex){ if (sex == \ || sex == \ || sex == \男\ || sex == \女\) break; else{ cout << \性别必须是male、female、男或者女,请重新输入:\; sin.str(gets()); sin.clear(); } } cout << endl << setw(20) << \身高(厘米):\; sin.str(gets()); sin.clear(); while (!(sin >> height)){ cout << \输入错误,请重新输入:\; sin.str(gets()); sin.clear(); } cout << endl << setw(20) << \年龄:\; sin.str(gets()); sin.clear(); while (!(sin >> age) || age > 300){ cout << \输入错误,请重新输入:\ << endl; sin.str(gets()); sin.clear(); } cout << endl << setw(20) << \学历:\;

sin.str(gets()); sin.clear(); sin >> education; cout << endl << setw(20) << \工作:\; sin.str(gets()); sin.clear(); sin >> job; cout << endl << setw(20) << \父亲:\; sin.str(gets()); sin.clear(); sin >> father; } catch (int ex){ throw ex; } return; }

搜索更多关于: 数据结构大作业之家谱管理系统 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

#include #include #include #include #include #include\ using std::cin; using std::cout; using std::endl; using std::setw; using std::vector; using std::ios; using std::ifstream; using std::ofstream; using std::istringstream; string gets(){//从控制台获取字符等信息 string s; while (int n = _getch()){ if (n == 27){ throw 27; break; } else if (n == 13

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com