|
|
@ -36,7 +36,7 @@ void save_data();
|
|
|
|
// 打印图书信息
|
|
|
|
// 打印图书信息
|
|
|
|
void print_data();
|
|
|
|
void print_data();
|
|
|
|
// 根据图书编号查询图书信息
|
|
|
|
// 根据图书编号查询图书信息
|
|
|
|
book *find(int id);
|
|
|
|
struct book *find(int id);
|
|
|
|
// 查询图书信息
|
|
|
|
// 查询图书信息
|
|
|
|
void query_data();
|
|
|
|
void query_data();
|
|
|
|
// 添加新图书信息
|
|
|
|
// 添加新图书信息
|
|
|
@ -56,4 +56,40 @@ int main()
|
|
|
|
display_menu();
|
|
|
|
display_menu();
|
|
|
|
make_choice();
|
|
|
|
make_choice();
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void init()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("图书管理系统启动");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void display_menu()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("1 读取 | 2 保存 | 3 打印 | 4 查询 | 5 添加\n6 修改 | 7 删除 | 8 排序 | 9 图表 | 0 退出");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void quit()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
char choice;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
printf("确定要退出吗?(Y/N):");
|
|
|
|
|
|
|
|
scanf(" %c", &choice);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(choice == 'Y' || choice == 'y')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("程序退出!\n");
|
|
|
|
|
|
|
|
exit(0); // 退出系统
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else if(choice == 'N' || choice == 'n')
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("退出操作已取消!\n");
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
printf("输入错误,请重新输入(Y/N):");
|
|
|
|
|
|
|
|
quit(); // 递归调用自己
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|