#includestdio.h#includestring.h#includestdlib.h#includeconio.h#definePT序号:%s姓名:%s性别:%s手机号:%sQQ:%s生日:%s\n,p-num,p-name,p-sex,p-phone,p-QQ,p-birthday#defineNsizeof(structstud)structstud{charnum[10];charname[15];charsex[15];charphone[15];charQQ[15];charbirthday[15];structstud*next;};structstud*creat(void){structstud*p1,*p2,*head;inti=1;charchoice;head=p2=(structstud*)malloc(N);printf(★**************************************************************★\n);printf(★*********************欢迎使用通讯录管理系统*******************★\n);printf(★**************************************************************★\n\n\n);printf(\n);printf(\n\n\n);printf(▲输入信息时请以空格间隔输入,一组通讯信息输入完后请按回车键结束▲\n\n\n);printf(※请输入序号姓名性别手机号QQ生日※\n);head-next=NULL;choice='y';for(i=1;choice=='y'||choice=='Y';i++){p1=(structstud*)malloc(N);scanf(%s%s%s%s%s%s,p1-num,p1-name,p1-sex,p1-phone,p1-QQ,p1-birthday);p2-next=p1;p2=p1;printf(\n是否继续?(Y/N):);choice=getche();printf(\n);}p2-next=NULL;returnhead;}voidinsert(structstud*head){structstud*p;p=(structstud*)malloc(N);printf(请输入要插入的序号姓名性别手机号QQ生日\n);scanf(%s%s%s%s%s%s,p-num,p-name,p-sex,p-phone,p-QQ,p-birthday);if(head-next!=NULL){p-next=head-next;head-next=p;}printf(\n通讯信息插入成功!按任意键继续!);getche();}voidmodify(structstud*h){charnumber[10];structstud*p;charchoice;printf(请输入要修改的通讯信息的序号:);scanf(%s,number);for(p=h;strcmp(p-num,number)!=0;p=p-next);while(1){printf(请输入修改后通讯信息:\n);printf(请输入要插入的序号姓名性别手机号QQ生日\n);scanf(%s%s%s%s%s%s,p-num,p-name,p-sex,p-phone,p-QQ,p-birthday);printf(修改后通讯信息如下:\n);printf(\n序号:%s姓名:%s性别:%s手机号:%sQQ:%s生日:%s\n,p-num,p-name,p-sex,p-phone,p-QQ,p-birthday);printf(\n确认?是Y否N:);choice=getche();if(choice=='y'||choice=='Y')break;}printf(\n修改成功,按任意键继续!);getche();}voidcut(structstud*p0){charnumber[10];structstud*p;charchoice;if(p0-next==NULL){printf(信息出错!按任意键退出!);getch();exit(1);}printf(请输入要删除的序号:);scanf(%s,number);for(p=p0-next;strcmp(p-num,number)!=0;p0=p,p=p-next);printf(你要删除的通讯信息如下,请确认是否删除:\n);printf(\n序号:%s姓名:%s性别:%s手机号:%sQQ:%s生日:%s\n,p-num,p-name,p-sex,p-phone,p-QQ,p-birthday);printf(\n是Y,否N:);choice=getche();if(choice=='Y'||choice=='y'){p0-next=p-next;free(p);printf(\n文件删除成功!);}printf(\n按任意键结束!);getche();}voidfind(structstud*h){charnumber[10];structstud*p;printf(请输入你要查找的序号:);scanf(%s,number);for(p=h;strcmp(p-num,number)!=0;p=p-next);printf(你查找的通讯信息如下:\n);printf(\n序号:%s姓名:%s性别:%s手机号:%sQQ:%s生日:%s\n,p-num,p-name,p-sex,p-phone,p-QQ,p-birthday);printf(按任意键继续!);getche();}voidprint(structstud*p){p=p-next;while(p!=NULL){printf(PT);p=p-next;}printf(\n按任意键继续!);getche();}voidsort(structstud*head){structstud*q,*t,*p;p=head;t=NULL;while(t!=head-next){p=head;q=p-next;while(q-next!=t){if(strcmp(p-next-num,q-next-num)0){p-next=q-next;q-next=q-next-next;p-next-next=q;}p=p-next;q=p-next;}t=q;}printf(通讯信息排序完毕,按任意键继续!);getche();}voidmain(){intchoice=1,i;structstud*head;head=NULL;head=creat();for(i=1;choice!=0;i++){system(cls);printf(★**************************************************************★\n);printf(§*******************★欢迎使用通讯录管理系统★*****************§\n);printf(§**************************************************************§\n);printf(§§§§\n);printf(§§§§\n);printf(§§§§\n);printf(§§☆1.添加通讯信息§§\n);printf(§§☆2.修改通讯信息§§\n);printf(§§☆3.删除通讯信息§§\n);printf(§§☆4.查询通讯信息§§\n);printf(§§☆5.显示通讯信息§§\n);printf(§§☆6.按序号排序通讯信息§§\n);printf(§§☆0.退出系统§§\n);printf(§§§§\n);printf(§§§§\n);printf(§§§§\n);printf(★**************************************************************★\n);printf(◆请选择(0-6):\n);scanf(%d,&choice);switch(choice){case1:insert(head);break;case2:modify(head);break;case3:cut(head);break;case4:find(head);break;case5:print(head);break;case6:sort(head);break;case0:break;}}}