From ad0865d010be62aadfeefb5d02abc2bb73aa3967 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Sat, 22 Apr 2023 15:56:26 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E7=B3=BB=E7=BB=9F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tushu.txt | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tushu.txt diff --git a/tushu.txt b/tushu.txt new file mode 100644 index 0000000..2c287e0 --- /dev/null +++ b/tushu.txt @@ -0,0 +1,24 @@ +void foundBook(Book* book1) +{ + Book* book = book1; + printf("输入要查找的书的id:"); + int id; + scanf("%d", &id); + getchar(); + while (book != NULL) + { + if (id == book->iNum) + { + printf("该书的信息如下:\n"); + printf("%d\t%s\t%s\t%s\t%d\n", book->iNum, book->acName, book->acAuthor, book->acPress, book->iAmount); + printf("按任意键返回\n"); + getchar(); + return; + } + book = book->next; + } + printf("没有找到该书!\n"); + printf("按任意键返回\n"); + getchar(); + return; +} \ No newline at end of file