From da8cf7e0afa55632e54f8f1a413cd2173674972e Mon Sep 17 00:00:00 2001 From: "18408000632@stu.hut.edu.cn" <18408000632@stu.hut.edu.cn> Date: Mon, 7 Jan 2019 21:49:18 +0800 Subject: [PATCH] first --- main.cpp | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 main.cpp diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..2785c35 --- /dev/null +++ b/main.cpp @@ -0,0 +1,72 @@ +#include +#include +#include +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; +}