-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtest.c
65 lines (59 loc) · 1.24 KB
/
test.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#define _CRT_SECURE_NO_WARNINGS 1
#include"contact.h"
void menu()
{
printf("**************CONTACTOR MENU***************\n");
printf("******** 1. add ********\n");
printf("******** 2. dele ********\n");
printf("******** 3. srch ********\n");
printf("******** 4. modf ********\n");
printf("******** 5. show ********\n");
printf("******** 6. emty ********\n");
printf("******** 7. sort ********\n");
printf("******** 0. EXIT ********\n");
}
void test()
{
contact con;
init_contact(&con);
int input;
do{
menu();
printf("请输入选项>:");
scanf("%d", &input);
switch (input)
{
case 1:
add_contact(&con);
break;
case 2:
dele_contact(&con);
break;
case 3:
srch_contact(&con);
break;
case 4:
modf_contact(&con);
break;
case 5:
show_contact(&con);
break;
case 6:
emty_contact(&con);
break;
case 7:
sort_contact(&con);
break;
case 0:
return;
default:
printf("错误的指令输入\n");
return;
}
} while (input); //使用do()while语句可以实现完成一个操作之后可以继续选择继续操作
}
int main()
{
test();
return 0;
}