|
|
|
@ -0,0 +1,72 @@
|
|
|
|
|
#include<stdio.h>
|
|
|
|
|
#include<stdlib.h>
|
|
|
|
|
#include<string.h>
|
|
|
|
|
typedef struct
|
|
|
|
|
{
|
|
|
|
|
char name[20];
|
|
|
|
|
char phonenum[20];
|
|
|
|
|
char kind[10];
|
|
|
|
|
char email[30];
|
|
|
|
|
} linkman;
|
|
|
|
|
int main_menu()
|
|
|
|
|
{
|
|
|
|
|
char c;
|
|
|
|
|
do{
|
|
|
|
|
|
|
|
|
|
printf("\t\t ════════════════\n");
|
|
|
|
|
printf("\t\t 手机通讯录小程序 \n");
|
|
|
|
|
printf("\t\t ════════════════\n");
|
|
|
|
|
printf("\t\t ┌────────────────┐\n");
|
|
|
|
|
printf("\t\t │ 1. 新增联系人 2. 全部联系人 │\n");
|
|
|
|
|
printf("\t\t │ │\n");
|
|
|
|
|
printf("\t\t │ 3. 查找联系人 4. 修改联系人 │\n");
|
|
|
|
|
printf("\t\t │ │\n");
|
|
|
|
|
printf("\t\t │ 5. 删除联系人 6. 拨号 │\n");
|
|
|
|
|
printf("\t\t │ │\n");
|
|
|
|
|
printf("\t\t │ 0. 退出程序 │\n");
|
|
|
|
|
printf("\t\t └────────────────┘\n");
|
|
|
|
|
printf("\t\t请您选择(0-6):");
|
|
|
|
|
c=getchar();
|
|
|
|
|
}while(c<'0'||c>'6');
|
|
|
|
|
return (c-'0');
|
|
|
|
|
}
|
|
|
|
|
main()
|
|
|
|
|
{
|
|
|
|
|
for(;;)
|
|
|
|
|
{
|
|
|
|
|
switch(main_menu())
|
|
|
|
|
{
|
|
|
|
|
case 1:
|
|
|
|
|
printf("\t\t --------新增联系人--------\n");
|
|
|
|
|
add();
|
|
|
|
|
break;
|
|
|
|
|
case 2:
|
|
|
|
|
printf("\t\t --------全部联系人--------\n");
|
|
|
|
|
view();
|
|
|
|
|
break;
|
|
|
|
|
case 3:
|
|
|
|
|
printf("\t\t --------查找联系人--------\n");
|
|
|
|
|
search();
|
|
|
|
|
break;
|
|
|
|
|
case 4:
|
|
|
|
|
printf("\t\t --------修改联系人--------\n");
|
|
|
|
|
amend();
|
|
|
|
|
break;
|
|
|
|
|
case 5:
|
|
|
|
|
printf("\t\t -----------拨号-----------\n");
|
|
|
|
|
delete();
|
|
|
|
|
break;
|
|
|
|
|
case 6:
|
|
|
|
|
printf("\t\t --------全部联系人--------\n");
|
|
|
|
|
dial();
|
|
|
|
|
break;
|
|
|
|
|
case 0;
|
|
|
|
|
printf("感谢使用,再见\n");
|
|
|
|
|
system("pause");
|
|
|
|
|
exit(0);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
return 0;
|
|
|
|
|
}
|