You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
# define _CRT_SECURE_NO_WARNINGS 1
# include "Contact.h"
void menu ( )
{
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 ( " 选择代码( 0, 1, 2, 3, 4, 5, 6 ,7 ) : \n " ) ;
}
void test ( )
{
Contact con ; //通讯录
InitContact ( & con ) ; //初始化通讯录
int input = 0 ;
do
{
menu ( ) ;
printf ( " 请选择:> " ) ;
scanf ( " %d " , & input ) ;
switch ( input )
{
case 1 : //增加联系人
AddContact ( & con ) ;
break ;
case 2 : //删除联系人
DelContact ( & con ) ;
break ;
case 3 : //查找联系人
SearchContact ( & con ) ;
break ;
case 4 : //修改联系人
ModifyContact ( & con ) ;
break ;
case 5 : //显示联系人
ShowContact ( & con ) ;
break ;
case 0 :
SaveContact ( & con ) ; //保存
DestroyContact ( & con ) ;
printf ( " 退出通讯录 \n " ) ;
break ;
case 6 : //清空联系人
EmptyContact ( & con ) ;
break ;
default :
printf ( " 选择错误 \n " ) ;
}
} while ( input ) ;
}
int main ( )
{
test ( ) ;
system ( " pause " ) ;
return 0 ;
}