通讯录管理系统的设计与实现c++源代码.docx

上传人:啊飒飒 文档编号:10269829 上传时间:2021-05-04 格式:DOCX 页数:6 大小:16.76KB
返回 下载 相关 举报
通讯录管理系统的设计与实现c++源代码.docx_第1页
第1页 / 共6页
通讯录管理系统的设计与实现c++源代码.docx_第2页
第2页 / 共6页
通讯录管理系统的设计与实现c++源代码.docx_第3页
第3页 / 共6页
通讯录管理系统的设计与实现c++源代码.docx_第4页
第4页 / 共6页
通讯录管理系统的设计与实现c++源代码.docx_第5页
第5页 / 共6页
点击查看更多>>
资源描述

《通讯录管理系统的设计与实现c++源代码.docx》由会员分享,可在线阅读,更多相关《通讯录管理系统的设计与实现c++源代码.docx(6页珍藏版)》请在三一文库上搜索。

1、通讯录管理系统的设计与实现源代码#include#include#include#includeusingnamespacestd;structStudentstringnum;/学号stringname;/姓名intage;chartel;charaddr;charemal;Student*next;longiCount=0;Student*head=NULL;Student*pEnd=NULL;voidLoadRecords(char*path)/从文本里面读取记录fstreaminfile(path,ios:in);if(!infile)elseinfileiCount;intt=iCo

2、unt;if(iCount!=0)for(;iCount0;iCount-)Student*p=newStudent;infilep-nump-namep-Maths;if(head=NULL)head=p;pEnd=p;pEnd-next=NULL;elsepEnd-next=p;pEnd=pEnd-next;pEnd-next=NULL;iCount=t;infile.close();voidPrint(Student*h)/打印记录if(h=NULL)coutn*nn;cout没有学生记录!n;coutn*n;return;coutn*nn;cout所有的学生:nn;cout-n;cou

3、t|setw(10)学号|setw(10)姓名|setw(10)年龄|setw(10)电话|setw(10)地址|setw(10)邮箱|n;while(h)cout-n;cout|setw(10)num|setw(10)name|setw(10)age|setw(10)tel|setw(10)addr|setw(10)emalnext;cout-n;coutn*nn;voidPrint_All(Student*h)/输出全部if(h=NULL)coutn*n;cout没有学生记录!n;coutn*n;return;coutn*n;cout所有学生:nn;cout-n;cout|setw(10)

4、学号|setw(10)姓名|setw(10)年龄|setw(10)电话|setw(10)地址|setw(10)邮箱number=1;h-number+cout-n;cout|setw(10)num|setw(10)name|setw(10)age|setw(10)tel|setw(10)addr|setw(10)emalnext;cout-n;coutn*nn;voidPrint_search(Student*h)/查询if(h=NULL)coutn*n;cout没有学生记录!n;coutn*n;return;coutn*n;cout所查学生:nn;cout-n;cout|setw(10)学号

5、|setw(10)姓名|setw(10)年龄|setw(10)电话|setw(10)地址|setw(10)邮箱number=i)cout-n;cout|setw(10)num|setw(10)name|setw(10)age|setw(10)tel|setw(10)addr|setw(10)emalnext;cout-n;coutnext=NULL;elsepEnd-next=s;pEnd=s;pEnd-next=NULL;coutn=n;coutname的资料添加完毕!n;cout=n;iCount+;voidmain()LoadRecords(c:test.txt);intn;coutn*

6、n;cout1增加一个学生n2显示所有的学生以及他们的成绩n3显示数组中学号为I的学生信息n4存盘并退出n;cout*nn;coutn;while(1)switch(n)case1:Student*p=newStudent;coutn*nn;cout请输入内容:endl;coutp-nump-namep-agep-telp-addrp-emal;Add(p);break;case2:Print(head);break;case3:Print_search(head);break;case4:fstreamoutfile(c:test.txt,ios:out);if(!outfile)elseoutfileiCount;while(head)outfilenumnameMathsnext;outfile.close();coutn=n;cout再见endl;cout=nn;return;default:coutn=n;cout无效输入endl;cout=nn;cout=1&n=5)coutn*n;cout1增加一个学生n2显示所有的学生以及他们的成绩n3显示数组中平均成绩40的学生以及他们的成绩n4显示数组中学号为I的学生信息n5存盘并退出n;cout*nn;coutn;

展开阅读全文
相关资源
猜你喜欢
相关搜索

当前位置:首页 > 科普知识


经营许可证编号:宁ICP备18001539号-1