From 0206e7273ea89279481f030688a933b3133ed80f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Thu, 27 Apr 2023 17:40:02 +0800 Subject: [PATCH 1/3] c10 --- README.md | 2 +- returnBook.svg | 234 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 235 insertions(+), 1 deletion(-) create mode 100644 returnBook.svg diff --git a/README.md b/README.md index 0d8bf6e..d3e59a2 100644 --- a/README.md +++ b/README.md @@ -700,7 +700,7 @@ C7:void foundReaderInfo(Reader* reader);\\查询读者信息 C8:Reader* LendBook(Reader* reader, Book* book);\\读者借书 ![888](LendBook.svg) C9:void returnBook(Reader* reader, Book* book);\\读者还书 - +![999](returnBook.svg) C10:void save(Book* book);\\文件保存 C11:Book* read1();\\从文件读取 diff --git a/returnBook.svg b/returnBook.svg new file mode 100644 index 0000000..694b1f2 --- /dev/null +++ b/returnBook.svg @@ -0,0 +1,234 @@ + + + + + + + + + + + + + + returnBook + (整数值 id) + + + + + + 结束 + + + + + + + + + + + + + + + + + + + + + + + 整数值 reader + + + + + + + + 整数值 id + + + + + + 输入 id + + + + + + + + getchar() + + + + + + + + + + + + + reader!=NULL + + + + + + + + + + + + + + + + + + id == reader->iNum + + + + + + + + + + + + + 整数值 id_book + + + + + + 输入 id_book + + + + + + + + + + + + + + + + + + reader->aiBookId[i] + + + + + + + + + + + book + + + + + + + + + + + + + + + + + + + + + + + i = 0 到 reader->iMax + + + + 下一个 + + + 完成 + + + + + + + + + + + + + + + + + reader != NULL + + + + + + + + + + + + + + + + + + + + + + + 输出 + + + + + + 输出 + + + + + + + + getchar() + + + + + From e79ca6c937d3c4cb594b180a0b6392496bb8efc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Thu, 27 Apr 2023 17:44:29 +0800 Subject: [PATCH 2/3] save --- README.md | 2 +- save.svg | 190 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 191 insertions(+), 1 deletion(-) create mode 100644 save.svg diff --git a/README.md b/README.md index d3e59a2..17b148d 100644 --- a/README.md +++ b/README.md @@ -702,6 +702,6 @@ C8:Reader* LendBook(Reader* reader, Book* book);\\读者借书 C9:void returnBook(Reader* reader, Book* book);\\读者还书 ![999](returnBook.svg) C10:void save(Book* book);\\文件保存 - +![000](save.svg) C11:Book* read1();\\从文件读取 diff --git a/save.svg b/save.svg new file mode 100644 index 0000000..1d09013 --- /dev/null +++ b/save.svg @@ -0,0 +1,190 @@ + + + + + + + + + + + + + + save + + + + + + 结束 + + + + + + + + + + + + + + + + + + + 阅读FILE + + + + + + + + 整数值 iCount + + + + + + + + + + + + + PCur == NULL + + + + + + 输出 + + + + + + + + + + + + + + + + + + + + + + + fp = fopen() == NULL + + + + + + + + + + + + + 输出 + + + + + + + + getchar() + + + + + + + + exit() + + + + + + + + + + + + + + + + fwrite(pCur, sizeof(Book),fp) + + + + + + pCur = pCur->next + + + + + + + PCur + + + + + + + + + + + + + + + + + + + + + + + + 输出 + + + + + + 输出 iCount + + + + + + + + fclose(fp) + + + + + From 1057f545f48ee211de20e21083040bc37faf8d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Thu, 27 Apr 2023 17:48:29 +0800 Subject: [PATCH 3/3] read --- Bookread.svg | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 Bookread.svg diff --git a/Bookread.svg b/Bookread.svg new file mode 100644 index 0000000..38cb431 --- /dev/null +++ b/Bookread.svg @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + Bookread + + + + + + 结束 + + + + + + + + + + + + + + + + + + + + + 阅读FILE + + + + + + Book pHead = NULL + + + + + + * pTemp = NULL + + + + + + *pTemp = NULL + + + + + + + + + + + + + fp = fopen() == NULL + + + + + + + + + 输出 + + + + + + + + exit() + + + + + + + + + + + + + + + + + pTemp = (Book*)malloc + (sizeof(Book)) + + + + + + + + + + + + + + + + + + + + !pHead + + + + + + pHead = pCur + + + + + + + + + pCur->next = pTemp + + + + + + pCur = pTemp + + + + + + + + + + + + + + + fread(pTemp, sizeof + (Book),1,fp) + + + + + + + + + + + + + + + fclose(fp) + + + + + diff --git a/README.md b/README.md index 17b148d..33b8f78 100644 --- a/README.md +++ b/README.md @@ -704,4 +704,4 @@ C9:void returnBook(Reader* reader, Book* book);\\读者还书 C10:void save(Book* book);\\文件保存 ![000](save.svg) C11:Book* read1();\\从文件读取 - +![111](Bookread.svg)