diff --git a/LendBook.svg b/LendBook.svg new file mode 100644 index 0000000..3c832b7 --- /dev/null +++ b/LendBook.svg @@ -0,0 +1,671 @@ + + + + + + + + + + + + + + LendBook + + + + + + End + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + String reader1 + + + + + + + + String book1 + + + + + + + + Integer id + + + + + + Input id + + + + + + Input reader + + + + + + + + + + + + + reader == NULL + + + + + + + + + + + + + Output Reader* tmp = + (Reader*)malloc(sizeof + (Reader)); + + + tmp->next = NULL + ; + + + tmp->iAmount = + 0; + + + tmp->iNum = id; + + + + + + Input 读者名字 + + + + + + Input 读者性别 + + + + + + Input 读者职位 + + + + + + + + True + + + False + + + + + + + + + + + + + + + strcmp(tmp->position, + "student"==0 + + + + + + Output iMax = + 20; + day = 30; + + + + + + Output tmp->iMax = + 40; + tmp->day = 60; + + + + + True + + + False + + + + + + + + + + + Output tmp->aiBookId[i] = 0 + + + + + + i = 0 to iMax + + + + Next + + + Done + + + + + + + + Integer idbook + + + + + + Input idbook + + + + + + Input book + + + + + + + + + + + + + + + + + + + + id_book == book->iNum + + + + + + + + + + + + + + + + book->iAmount <= 1 + + + + + + + + + Output + 借阅失败该图书库存不足 + + + + + + Output 返回NULL + + + + + + + + True + + + False + + + + + + + + + + + + + (tmp->iAmount) + 1 > tmp-> + iMax + + + + + + + + + Output + 借阅失败该读者借阅图书数量已达上线 + + + + + + Output 返回NULL + + + + + + + + True + + + False + + + + + + + + + + Output 借阅成功 + + + + + + Output 返回reader + + + + + + True + + + False + + + + + + book!=NULL + + + + True + + + False + + + + + + Output book = book->next + + + + + + Output 没有找到该书 + + + + + + Output 返回reader1 + + + + + + + + + + + + + + + reader!=NULL + + + + + + + + + + + + + + + + + + + + + + + + + + + + id == reader->iNum + + + + + + + + + + + Output 图使馆当前的书册籍 + + + + + + Input 要借的书的编号 + + + + + + + + + + + + + + + + + + id_book == book->iNum + + + + + + + + + + + + + + + + book->iAmount <= 1 + + + + + + + + + Output 借阅失败 + + + + + + Output returnreader1 + + + + + + + + True + + + False + + + + + + + + + + + + + (tmpp->iAmount + 1 > tmpp + ->iMax + + + + + + + + + Output 借阅失败, + 该读者借阅图书数量已达上线 + + + + + + Output 返回reader1 + + + + + + + + True + + + False + + + + + + + + True + + + False + + + + + + book!=NULL + + + + True + + + False + + + + + + + + + + + + Output reader->iAmount++ + + + + + + Output reader->aiBookId + [tmpp->iAmount] = id_book + + + + + + Output 返回reader1 + + + + + + True + + + False + + + + + + Output book = book->next + + + + + + + reader != NULL + + + + True + + + False + + + + + + Output 没有找到该书 + + + + + + Output 按任意键返回 + + + + + + + Output reader = reader-> + next + + + + + True + + + False + + + + + diff --git a/README.md b/README.md index e24d3ba..0d8bf6e 100644 --- a/README.md +++ b/README.md @@ -698,7 +698,7 @@ C6:void foundReader_Info(Reader* reader);\\查询读者的借阅信息 C7:void foundReaderInfo(Reader* reader);\\查询读者信息 ![777](ReaderInfo.svg) C8:Reader* LendBook(Reader* reader, Book* book);\\读者借书 - +![888](LendBook.svg) C9:void returnBook(Reader* reader, Book* book);\\读者还书 C10:void save(Book* book);\\文件保存