From 64942727bd1d54a2864378f32af85cc0c3856225 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=BC=A0=E6=B1=9F=E6=A5=A0?= <87896121@qq.com> Date: Thu, 27 Apr 2023 21:24:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B5=81=E7=A8=8B=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- c2.svg | 128 ++++++++++++++++++++++++++ c3.svg | 75 +++++++++++++++ c4.svg | 281 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ c5.svg | 183 +++++++++++++++++++++++++++++++++++++ 4 files changed, 667 insertions(+) create mode 100644 c2.svg create mode 100644 c3.svg create mode 100644 c4.svg create mode 100644 c5.svg diff --git a/c2.svg b/c2.svg new file mode 100644 index 0000000..5192a7b --- /dev/null +++ b/c2.svg @@ -0,0 +1,128 @@ + + + + + + + + + + + + + + 开始 + + + + + + End + + + + + + + + + + + + + + + + + + + + + Integer Book*book=book1 + Reader*reader=reader1 + + + + + + bookNUm = 0 + + + + + + readerNUm = 0 + + + + + + mangerNUm = 0 + + + + + + + + + + + Output readerNUm + ++; + reader=reader->next; + + + + + + reader!=NULL + + + + True + + + False + + + + + + + + + + + Output readerNUm + ++; + reader=reader->next; + + + + + + reader!=NULL + + + + True + + + False + + + + + + Output printf + ("本图书馆共有藏书%d本, + 读者%d人\n", bookNUm, + readerNUm); + printf + ("按任意键返回\n"); + + + + + diff --git a/c3.svg b/c3.svg new file mode 100644 index 0000000..2492f51 --- /dev/null +++ b/c3.svg @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + Main + + + + + + End + + + + + + + + + + + Book*book = book1 + + + + + + + + + + + Output printf("%d\t%s\t%s\t + %s\t%d\n", book->iNum, + book->acName, book-> + acAuthor, book->acPress, + book-> + iAmount); + book = book->next; + + + + + + book!=NULL + + + + True + + + False + + + + + + Output printf("\ + n按任意键返回\ + n"); + getchar(); + + + + + diff --git a/c4.svg b/c4.svg new file mode 100644 index 0000000..3ce429f --- /dev/null +++ b/c4.svg @@ -0,0 +1,281 @@ + + + + + + + + + + + + + + kaishi + + + + + + End + + + + + + + + + + + + + Book*book = book1 + + + + + + + + + + + + + book==NULL + + + + + + Output Book* tmp = (Book*) + malloc(sizeof + (Book)); + tmp->next = NULL + ; + assert + (tmp); + printf + ("输入书的编号:"); + scanf("%d", &tmp-> + iNum); + getchar + (); + printf + ("输入书的名称:"); + gets(&tmp-> + acName); + printf + ("输入书的作者:"); + gets(tmp-> + acAuthor); + printf + ("输入书的出版社:"); + gets(tmp-> + acPress); + printf + ("输入书的库存量:"); + scanf("%d", &tmp-> + iAmount); + book = tmp + ; + + + printf("按任意键返回\ + n"); + getchar + (); + return book; + + + + + + + True + + + False + + + + + + + + + + + + + + + + + + + + + + + + + + Integer flag + + + + + + flag = 1 + + + + + + + + + + + + + + Output Book* tmp = (Book*) + malloc(sizeof + (Book)); + + + tmp->next = NULL + ; + assert + (tmp); + printf + ("输入书的编号:"); + scanf("%d", &tmp-> + iNum); + getchar + (); + printf + ("输入书的名称:"); + gets(&tmp-> + acName); + printf + ("输入书的作者:"); + gets(tmp-> + acAuthor); + printf + ("输入书的出版社:"); + gets(tmp-> + acPress); + printf + ("输入书的库存量:"); + scanf("%d", &tmp-> + iAmount); + + + book->next = tmp + ; + + + printf("是否继续输入:1==> + 继续\t0==>结束\ + t"); + scanf("%d", & + flag); + getchar(); + + + + + + + + + + + + + flag==0 + + + + + + Output printf("按任意键返回\ + n"); + getchar + (); + return book1; + + + + + + + True + + + False + + + + + + + flag + + + + True + + + False + + + + + + + book->next==NULL + + + + True + + + False + + + + + + Output book=book->next + + + + + + + 1 + + + + True + + + False + + + + + + Output printf("按任意键返回\ + n"); + getchar(); + + + + + diff --git a/c5.svg b/c5.svg new file mode 100644 index 0000000..50c3f7b --- /dev/null +++ b/c5.svg @@ -0,0 +1,183 @@ + + + + + + + + + + + + + + begin + + + + + + Return Integer book1 + + + + + + + + + + + + + + + + + + + Book*book = book1 + + + + + + Book*pre = book1 + + + + + + Output printf + ("输入要处理旧书的编号:"); + + + + + + + + Integer id + + + + + + Input id + + + + + + + + + + + + + + + + + + + + id==book->iNUm + + + + + + + + + + + + + + + book1==book + + + + + + Output book = book->next + ; + free + (prev); + return book; + + + + + + Output prev->next = book-> + next + ; + free(book); // + free + ():释放资源 + printf + ("已将旧书处理掉!\ + n"); + printf("按任意键返回\ + n"); + getchar + (); + return book1; + + + + + True + + + False + + + + + + Output prev = book + ; + book = book->next; + + + + + True + + + False + + + + + + book!=NULL + + + + True + + + False + + + + + + Output printf + ("没有找到该图书\ + n"); + printf("按任意键返回\ + n"); + getchar(); + + + + + -- 2.34.1