From 3edd7f021b4f6c95fc3dc9618c0dcc74d1bedaf2 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 16:07:13 +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 --- 图书管理系统.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/图书管理系统.c b/图书管理系统.c index bd89246..87f155c 100644 --- a/图书管理系统.c +++ b/图书管理系统.c @@ -273,3 +273,27 @@ Book* DealoldBook(Book* book1) return book1; } +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; +}