手机通讯录c++代码.docx

上传人:牧羊曲112 文档编号:3537649 上传时间:2023-03-13 格式:DOCX 页数:6 大小:37.75KB
返回 下载 相关 举报
手机通讯录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页
亲,该文档总共6页,到这儿已超出免费预览范围,如果喜欢就下载吧!
资源描述

《手机通讯录c++代码.docx》由会员分享,可在线阅读,更多相关《手机通讯录c++代码.docx(6页珍藏版)》请在三一办公上搜索。

1、手机通讯录c+代码#include #include #include #include #include #include #include #include #include #define inf 1000000000 #define M 50 #define MAXM 500000+10 using namespace std; int front=0; bool end=false; struct ss int index; char nameM;/姓名 char telM;/电话 char addressM;/地址 char characterM;/关系 char mailM;/邮

2、箱 yxc20; void looking int head=0; if(front=0) printf(手机中暂时无任何联系人n); return ; cout*通讯录*endl; while(headfront) printf(*Case%d:%s %s %s %s %sn,yxchead.index+1,yxchead.name,yxchead.tel,yxchead.character,yxchead.mail,yxchead.address); head+; bool again(char llM)/查找是否含有重复姓名 int head=0; while(headfront) if

3、(strcmp(yxchead.name,ll)=0) return true; head+; return false; void del looking; if(front=0) cout*通讯录空!endl; return; cout*您想删除哪条:endl; int which; scanf(%d,&which); while(whichfront) yxcwhich.index=which+1; strcpy(yxcwhich+1.address,yxcwhich.address); strcpy(yxcwhich+1.character,yxcwhich.character); s

4、trcpy(yxcwhich+1.mail,yxcwhich.mail); strcpy(yxcwhich+1.name,yxcwhich.name); strcpy(yxcwhich+1.tel,yxcwhich.tel); which+; front-; cout是否继续删除:Y/Nendl; getchar; char ch; scanf(%c,&ch); if(ch=Y) del; else return ; void leibie char ch; getchar; cout=10) char next; cout当前通讯路已经超过10条,不能再录入数据endl; cout是否删除某

5、些信息再录入Y/Nnext; if(next=Y) del; add; else return ; coutyxcfront.name; if(again(yxcfront.name) cout*已存在联系人,录入结束!endl; return ; yxcfront.index=front; coutyxcfront.tel; leibie; coutyxcfront.mail; coutyxcfront.address; front+; cout已添加联系人!endl; void update looking; coutendl; cout请选择更新哪条:; int head; scanf(

6、%d,&head); printf(*Case%d:%s %s %s %s %sn,yxchead.index,yxchead.name,yxchead.tel,yxchead.character,yxchead.mail,yxchead.address); coutyxchead.name; yxchead.index=head; coutyxchead.tel; leibie; coutyxchead.mail; coutyxchead.address; void GOODBYE cout*endl; coutendlendl; coutendlendl; coutendlendl; co

7、utendlendl; cout 谢谢使用手机通讯录管理系统endl; cout 再见!endl; coutendlendl; coutendlendl; coutendlendl; coutendlendl; cout*endl; void NEXT(int a) if(a=5) end=true; else if(a=1) looking; else if(a=2) add; else if(a=3) update; else del; return ; void GO int next; cout*endl; cout*endl; cout*endl; cout* 请选择以下功能:end

8、l; cout* 1.浏览手机中的联系人endl; cout* 2.添加联系人endl; cout* 3.修改联系人endl; cout* 4.删除联系人endl; cout* 5.关闭通讯录endl; cout*endl; cout*endl; cout*endl; cout*endl; scanf(%d,&next); NEXT(next); int main system(cls); system(color 2e); cout*endl; coutendlendl; coutendlendl; coutendlendl; coutendlendl; cout 欢迎使用手机通讯录管理系统endl; coutendlendl; coutendlendl; coutendlendl; coutendlendl; coutendlendl; cout*endl; char first; while(true) cout 继续进入选择功能Y/N?:endl; scanf(%c,&first); if(first=N) GOODBYE;return 0; GO; if(end) return 0; system(cls); return 0;

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

当前位置:首页 > 生活休闲 > 在线阅读


备案号:宁ICP备20000045号-2

经营许可证:宁B2-20210002

宁公网安备 64010402000987号