/*
Project design
Using link_list to realize the booklibary Management System
Library is a place that provide students to borrow and return.The books information is very important for students.
Now design a project to Imitate the library and can retrieve information fastly.
The books have this type of structure which are book_id ,bookname,book type,books_status.
You can define structure and program as following.
1) add books
2) list books
3) search books
4) borrow books
5) return books
6) exit
add books : you can type from keyboard to input books information one by one.
Each book should be given some prompt ,for example : “you input the 1str book id :” and so on.
List books : after you select 2,then display all books according to certain format
Search books : you can select some books according to book name or book type.So you should create sub menu to selected.
Borrow books: means borrow some books from library,so in the library the book status will be edited to having borrowed.
return books: put the books status change no having borrowed.
*/
#include
#include
#include
#define BORROWED 1
#define NOBORROW 0
/* 定义图书结构 */
struct Book
{
int _id; // 编号,唯一
char _name[32]; // 图书的名称,不唯一
int _type; // 图书的类型,不唯一
int _status; // 图书的状态,借出/没有借出
int _count; // 图书借出的次数
struct Book* _next; // 下一本书
struct Book* _prev; // 上一本书
};
/* 定义图书类型 */
typedef struct Book Book;
/* 操作的目录提示 */
char book_menu[][32] =
{
"add books",
"list books