C++编程之通讯录.docx
《C++编程之通讯录.docx》由会员分享,可在线阅读,更多相关《C++编程之通讯录.docx(22页珍藏版)》请在冰豆网上搜索。
C++编程之通讯录
“通讯录”程序设计报告
第一完成人:
黄斌斌(2013211000)
第二完成人:
刘炜伦(2013210999)
王龙(2013210998)
【设计背景】
设计一个本班同学的通讯录并能实现:
1.通讯录的编辑(添加、删除及修改);2.能够按不同的项进行查找(例如按姓名、按电话号码查找);3.对已存的通讯录按不同的项进行排序;4.将通讯录写入文件;5.从文件读入通讯录。
备注:
通讯录中至少应该有以下数据:
姓名,地址,电话,邮编,E-mail。
【设计思路】
首先,通讯录要有一个主菜单,通过主菜单上面的选项进行对通讯录的操作。
例如,浏览通讯录,将文件中保存的联系人在界面上显示供用户查阅;通过添加、删除及修改选项对通讯录内存有的联系人进行修改;通过查找选项快速查找到所需查找的联系人讯息;通过退出选项退出程序。
那么,在编写程序的时候首先要定义一个联系人的类people。
然后编写主函数,使用户再选择退出选项之前可以随心所欲在通讯录中获得足够的讯息。
【模块分析】
本通讯录分为六大模块:
1.主界面模块;
2.浏览联系人模块;
3.添加联系人模块;
4.删除联系人模块;
5.修改联系人模块;
6查找联系人模块;
1.主界面模块:
主界面模块下图所示,主界面有六个选项可选择:
浏览、新增、删除、修改、查找及退出。
选择其中一个选项则跳到相应的模块,在其他模块进行操作完毕后返回主界面进行循环,选择0.退出则为退出通讯录。
图1主界面
操作指南:
若输入为0-5,则进行相应的操作;若输入其他字符,就会显示“输入错误,请重新选择”,并循环回主界面,让用户重新选择。
图2输入错误界面
2.浏览联系人模块:
选择主界面的1选项后跳到本模块,立即显示在通讯录中所有的联系人,并默认按姓名排序,此外,模块末尾处有七个选项,选择后可按不同的项对联系人进行排序,或者选择0.退出返回主界面。
图3浏览联系人界面
选择输入1-6进行不同项的排序,选择0返回主界面;若输入其他字符就会提示“选择有误,请重新进行选择:
”,并让用户重新选择。
图4输入错误界面
3.添加联系人模块:
在主界面选择2.新增进入此模块,随后用户可根据界面提示依次输入联系人的姓名、地址、电话号码、QQ号码、邮箱及邮政编码。
输入完毕后程序将联系人保存至文件中,并将通讯录中所有联系人按姓名依次显示出来,方便用户确认保存成功,并在末尾显示“保存联系人成功!
!
”字样。
随后返回主界面供用户进行其他操作。
4.查找联系人模块:
通过主界面的3选项进入此模块,此模块下可通过不同的选项进行查找联系人,并在查找成功后将所有符合条件的联系人显示出来,若搜索不到符合条件的联系人,则显示“查找的联系人不存在!
”字样
图5查找成功
图6查找失败
5.删除联系人模块:
在主界面选择4选项之后进入此模块,此模块会将文件中存有的所有通讯录联系人按姓名依次显示,在每一个联系人前面有一个编号,用户只需输入所要删除的联系人的编号,便可从文件中删除此联系人的所有相关信息。
并将剩余联系人按名字依次显示,让用户确信联系人已经删除,同时显示“删除联系人成功!
”字样,随后返回主界面。
图7删除联系人成功
若是输入编号之外的字符,则会显示“没有这个编号,请重新输入:
”并让用户重新输入直至输入正确的编号。
图8输入编号错误
6.修改联系人模块:
在主界面选择5选项进入此模块,此模块会将文件中存有的所有通讯录联系人按姓名依次显示,在每一个联系人前面有一个编号,用户只需输入所要修改的联系人的编号,便会出现提示依次修改联系人的用户信息,保存到文件中,显示文件中所有联系人并会出现“修改联系人成功!
图9修改联系人输入图
图10修改联系人显示图
若出入编号之外的字符,将会如删除联系人模块一样显示“没有这个编号,请重新输入:
”字样,让用户重新输入直至输入正确的编号。
【测试完善】
本通讯录在编写完毕后仍存在一些不足之处。
首先是主界面选择时,如果用户输入0到5的其他字符如“a”,那么程序将会出现错误,只能强行关闭。
随后我们采用了强制转换的方法,使得choose的值在0到7之内,避免程序崩溃。
再一个是在删除联系人以及修改联系人的编号选择上也出现了同样的问题,但是编号的值范围可能是两位数或者三位数,那么强制转换的方法就行不通了,所以使用到了atoi函数,使用这个函数能使输入的字符串中的数字字符转换成整型,而其他字符则转换为0。
【附:
源代码】
//by201321099820132109992013211000
#include
usingnamespacestd;
classpeople
{public:
people(){name="\0";addr="\0";tele="\0";qq="\0";email="\0";post="\0";}
friendvoidscan();//浏览联系人,默认按名字排序
friendvoidadd();//添加联系人
friendvoiddel();//删除联系人
friendvoidmodify();//修改联系人信息
friendvoidsearch_name();//按姓名查找
friendvoidsearch_addr();//按地址查找
friendvoidsearch_tele();//按电话号码查找
friendvoidsearch_post();//按邮编查找
friendvoidsearch_email();//按邮箱查找
friendvoidsearch_qq();//按QQ号码查找
friendvoidscan_addr();
friendvoidscan_tele();
friendvoidscan_post();
friendvoidscan_email();
friendvoidscan_qq();
friendvoidshow();
private:
stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;
};
peoplea[200];//创建数组
voidarrange();
voidarrange_1()//输出排序选项
{cout<<""<cout<<"1.按姓名排序2.按地址排序3.按电话号码排序"<cout<<"4.按邮编排序5.按邮箱排序6.按QQ号码排序"<cout<<"0.退出(返回首页)"<cout<<"请选择:";}intchoose_1()//强制转换函数,保证choose在0-6之间{intchoose=1;chartem[10];scanf("%s",&tem);if(strlen(tem)>1)choose=7;else{if(tem[0]<48||tem[0]>54)choose=7;elsechoose=tem[0]-48;}return(choose);}voidsearch()//查找联系人函数{intchoose=1;chartem;cout<<"1.按姓名查找2.按地址查找3.按电话号码查找"<cout<<"4.按邮编查找5.按邮箱查找6.按QQ号码查找"<cout<<"0.退出(返回首页)"<cout<<"请输入您的选择:";choose=choose_1();switch(choose){case1:search_name();break;case2:search_addr();break;case3:search_tele();break;case4:search_post();break;case5:search_email();break;case6:search_qq();break;case0:break;;}cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"1.按姓名排序2.按地址排序3.按电话号码排序"<cout<<"4.按邮编排序5.按邮箱排序6.按QQ号码排序"<cout<<"0.退出(返回首页)"<cout<<"请选择:";}intchoose_1()//强制转换函数,保证choose在0-6之间{intchoose=1;chartem[10];scanf("%s",&tem);if(strlen(tem)>1)choose=7;else{if(tem[0]<48||tem[0]>54)choose=7;elsechoose=tem[0]-48;}return(choose);}voidsearch()//查找联系人函数{intchoose=1;chartem;cout<<"1.按姓名查找2.按地址查找3.按电话号码查找"<cout<<"4.按邮编查找5.按邮箱查找6.按QQ号码查找"<cout<<"0.退出(返回首页)"<cout<<"请输入您的选择:";choose=choose_1();switch(choose){case1:search_name();break;case2:search_addr();break;case3:search_tele();break;case4:search_post();break;case5:search_email();break;case6:search_qq();break;case0:break;;}cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"4.按邮编排序5.按邮箱排序6.按QQ号码排序"<cout<<"0.退出(返回首页)"<cout<<"请选择:";}intchoose_1()//强制转换函数,保证choose在0-6之间{intchoose=1;chartem[10];scanf("%s",&tem);if(strlen(tem)>1)choose=7;else{if(tem[0]<48||tem[0]>54)choose=7;elsechoose=tem[0]-48;}return(choose);}voidsearch()//查找联系人函数{intchoose=1;chartem;cout<<"1.按姓名查找2.按地址查找3.按电话号码查找"<cout<<"4.按邮编查找5.按邮箱查找6.按QQ号码查找"<cout<<"0.退出(返回首页)"<cout<<"请输入您的选择:";choose=choose_1();switch(choose){case1:search_name();break;case2:search_addr();break;case3:search_tele();break;case4:search_post();break;case5:search_email();break;case6:search_qq();break;case0:break;;}cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"0.退出(返回首页)"<cout<<"请选择:";}intchoose_1()//强制转换函数,保证choose在0-6之间{intchoose=1;chartem[10];scanf("%s",&tem);if(strlen(tem)>1)choose=7;else{if(tem[0]<48||tem[0]>54)choose=7;elsechoose=tem[0]-48;}return(choose);}voidsearch()//查找联系人函数{intchoose=1;chartem;cout<<"1.按姓名查找2.按地址查找3.按电话号码查找"<cout<<"4.按邮编查找5.按邮箱查找6.按QQ号码查找"<cout<<"0.退出(返回首页)"<cout<<"请输入您的选择:";choose=choose_1();switch(choose){case1:search_name();break;case2:search_addr();break;case3:search_tele();break;case4:search_post();break;case5:search_email();break;case6:search_qq();break;case0:break;;}cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"请选择:
";
}
intchoose_1()//强制转换函数,保证choose在0-6之间
{intchoose=1;chartem[10];
scanf("%s",&tem);
if(strlen(tem)>1)choose=7;
else
{
if(tem[0]<48||tem[0]>54)choose=7;
elsechoose=tem[0]-48;
return(choose);
voidsearch()//查找联系人函数
intchoose=1;chartem;
cout<<"1.按姓名查找2.按地址查找3.按电话号码查找"<cout<<"4.按邮编查找5.按邮箱查找6.按QQ号码查找"<cout<<"0.退出(返回首页)"<cout<<"请输入您的选择:";choose=choose_1();switch(choose){case1:search_name();break;case2:search_addr();break;case3:search_tele();break;case4:search_post();break;case5:search_email();break;case6:search_qq();break;case0:break;;}cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"4.按邮编查找5.按邮箱查找6.按QQ号码查找"<cout<<"0.退出(返回首页)"<cout<<"请输入您的选择:";choose=choose_1();switch(choose){case1:search_name();break;case2:search_addr();break;case3:search_tele();break;case4:search_post();break;case5:search_email();break;case6:search_qq();break;case0:break;;}cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"0.退出(返回首页)"<cout<<"请输入您的选择:";choose=choose_1();switch(choose){case1:search_name();break;case2:search_addr();break;case3:search_tele();break;case4:search_post();break;case5:search_email();break;case6:search_qq();break;case0:break;;}cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"请输入您的选择:
choose=choose_1();
switch(choose)
{case1:
search_name();break;
case2:
search_addr();break;
case3:
search_tele();break;
case4:
search_post();break;
case5:
search_email();break;
case6:
search_qq();break;
case0:
break;;
cout<<""<system("pause");}voidshow(){cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
system("pause");
voidshow()
{cout<<"现有联系人:
"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
for(inti=0;(i<200)&&(a[i].name!
="\0");i++)//按名字输出
{cout<<"编号:
"<
"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"地址:
"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<cout<<"邮箱:"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"邮箱:
"<"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<}cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<""<}voidscan_addr()//按地址排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].addr=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
voidscan_addr()//按地址排序
{scan();system("cls");
intnum=0;peopleb;
for(inti=0;i<200;i++)
if(a[i].addr=="\0")
{num=i;break;}//num记录通讯录现有联系人个数
for(inti=0;i<200;i++)//冒泡排序法
{for(intj=0;jif(a[j].addr>a[j+1].addr){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_tele()//按电话号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].tele=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
if(a[j].addr>a[j+1].addr)
{b=a[j+1];a[j+1]=a[j];a[j]=b;}
show();
voidscan_tele()//按电话号码排序
if(a[i].tele=="\0")
{for(intj=0;jif(a[j].tele>a[j+1].tele){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_post()//按邮编排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].post=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
if(a[j].tele>a[j+1].tele)
voidscan_post()//按邮编排序
if(a[i].post=="\0")
{for(intj=0;jif(a[j].post>a[j+1].post){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_email()//按邮箱排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].email=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
if(a[j].post>a[j+1].post)
voidscan_email()//按邮箱排序
if(a[i].email=="\0")
{for(intj=0;jif(a[j].email>a[j+1].email){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidscan_qq()//按QQ号码排序{scan();system("cls");intnum=0;peopleb;for(inti=0;i<200;i++)if(a[i].qq=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
if(a[j].email>a[j+1].email)
voidscan_qq()//按QQ号码排序
if(a[i].qq=="\0")
{for(intj=0;jif(a[j].qq>a[j+1].qq){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();}voidarrange()//排序函数{intchoose;do{arrange_1();choose=choose_1();switch(choose){case1:system("cls");scan();break;case2:scan_addr();break;case3:scan_tele();break;case4:scan_post();break;case5:scan_email();break;case6:scan_qq();break;case0:break;default:cout<<"选择有误!请重新选择:";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
if(a[j].qq>a[j+1].qq)
voidarrange()//排序函数
{intchoose;
do{
arrange_1();
system("cls");scan();break;
scan_addr();break;
scan_tele();break;
scan_post();break;
scan_email();break;
scan_qq();break;
break;
default:
cout<<"选择有误!
请重新选择:
";cout<<""<}}while(choose!=0);}voidmodify()//修改联系人{peopleb;intnum=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
}while(choose!
=0);
voidmodify()//修改联系人
{peopleb;intnum=0;chartem[20];
ifstreamfin;
fin.open("tongxunlu.txt",ios:
:
in);
{fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}
fin.close();
if(a[i].name=="\0")
{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();intk=0;cout<<"请输入将修改的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
if(a[j].name>a[j+1].name)
intk=0;cout<<"请输入将修改的联系人编号:
scanf("%s",&tem);k=atoi(tem);
while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:
";scanf("%s",&tem);k=atoi(tem);}
cout<<"联系人“"<!!"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<cout<<"请输入姓名:";cin>>a[k-1].name;cout<<"请输入地址:";cin>>a[k-1].addr;cout<<"请输入电话号码:";cin>>a[k-1].tele;cout<<"请输入QQ号码:";cin>>a[k-1].qq;cout<<"请输入邮箱:";cin>>a[k-1].email;cout<<"请输入邮政编码:";cin>>a[k-1].post;ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"请输入姓名:
";cin>>a[k-1].name;
cout<<"请输入地址:
";cin>>a[k-1].addr;
cout<<"请输入电话号码:
";cin>>a[k-1].tele;
cout<<"请输入QQ号码:
";cin>>a[k-1].qq;
cout<<"请输入邮箱:
";cin>>a[k-1].email;
cout<<"请输入邮政编码:
";cin>>a[k-1].post;
ofstreamfout;
fout.open("tongxunlu.txt",ios:
out);
system("cls");cout<<""<for(inti=0;(i<200)&&(a[i].name!="\0");i++){fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
="\0");i++)
{fout<fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
fout<}fout.close();scan();cout<<"修改联系人成功!!!"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
fout.close();
scan();
cout<<"修改联系人成功!
!
"<system("pause");}voiddel()//删除联系人{peopleb;intnum=0,i=0,k=0;chartem[20];ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
voiddel()//删除联系人
{peopleb;intnum=0,i=0,k=0;chartem[20];
{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}show();cout<<"请输入将删除的联系人编号:";scanf("%s",&tem);k=atoi(tem);while(k>=num||k<=0){cout<<"没有这么个编号,请重新输入:";scanf("%s",&tem);k=atoi(tem);}cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"请输入将删除的联系人编号:
";scanf("%s",&tem);k=atoi(tem);
cout<<"联系人“"<!!"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<system("pause");for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
for(k;ka[k-1]=a[k];a[num-1]=people();ofstreamfout;fout.open("tongxunlu.txt",ios::out);system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
a[k-1]=a[k];
a[num-1]=people();
system("cls");cout<<""<for(intk=0;(k<200)&&(a[k].name!="\0");k++){fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
for(intk=0;(k<200)&&(a[k].name!
="\0");k++)
{fout<fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
fout<}fout.close();scan();cout<<"删除联系人成功!!!"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"删除联系人成功!
"<system("pause");}voidadd()//添加联系人{ofstreamfout;fout.open("tongxunlu.txt",ios::app);//打开文件stringname;stringaddr;stringtele;stringqq;stringemail;stringpost;cout<<"请输入姓名:";cin>>name;cout<<"请输入地址:";cin>>addr;cout<<"请输入电话号码:";cin>>tele;cout<<"请输入QQ号码:";cin>>qq;cout<<"请输入邮箱:";cin>>email;cout<<"请输入邮政编码:";cin>>post;fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
voidadd()//添加联系人
{ofstreamfout;
app);//打开文件
";cin>>name;
";cin>>addr;
";cin>>tele;
";cin>>qq;
";cin>>email;
";cin>>post;
fout<fout.close();scan();cout<<"保存联系人成功!!!"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"保存联系人成功!
"<system("pause");}voidscan()//浏览联系人,默认按名字排序{peopleb;intnum=0;ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();for(inti=0;i<200;i++)if(a[i].name=="\0"){num=i;break;}//num记录通讯录现有联系人个数for(inti=0;i<200;i++)//冒泡排序法{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
voidscan()//浏览联系人,默认按名字排序
{peopleb;intnum=0;
{for(intj=0;jif(a[j].name>a[j+1].name){b=a[j+1];a[j+1]=a[j];a[j]=b;}}cout<<"现有联系人:"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<"现有联系人:
"<for(inti=0;(i<200)&&(a[i].name!="\0");i++)//按名字输出{cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<cout<<"邮箱:"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<}cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
cout<<""<}voidsearch_name()//按名字查找{ifstreamfin;fin.open("tongxunlu.txt",ios::in);for(inti=0;i<200;i++){fin>>a[i].name>>a[i].addr>>a[i].tele>>a[i].qq>>a[i].email>>a[i].post;}fin.close();stringtem;intk=0,i=0;cout<<"请输入查找的名字:";cin>>tem;for(i=0;i<200&&a[i].name!="\0";i++)if(a[i].name==tem){k=1;cout<<"编号:"<"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
voidsearch_name()//按名字查找
{ifstreamfin;
stringtem;intk=0,i=0;
cout<<"请输入查找的名字:
";cin>>tem;
for(i=0;i<200&&a[i].name!
="\0";i++)
if(a[i].name==tem)
{k=1;
cout<<"编号:
"<cout<<"地址:"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<cout<<"邮箱:"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
"<}if(k==0)cout<<"查找的联系人不存在!!!"<<
if(k==0)
cout<<"查找的联系人不存在!
"<<
copyright@ 2008-2022 冰豆网网站版权所有
经营许可证编号:鄂ICP备2022015515号-1