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 6da0afa..e221700 100644 --- a/README.md +++ b/README.md @@ -700,8 +700,8 @@ 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);\\文件保存 - +![000](save.svg) C11:Book* read1();\\从文件读取 - +![111](Bookread.svg) 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() + + + + + 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) + + + + +