Compare commits

..

2 Commits

@ -77,7 +77,26 @@ void ShowMainMenu()
函数原形void ShowLibInfo(const Book* book, const Reader* reader);
功能:接受两个形参,分别是图书的链表地址,读者的链表地址,并遍历两个链表,显示出图书的数量和读者的数量
```
void ShowLibInfo(const Book* book1, const Reader* reader1)
{
Book* book = book1;
Reader* reader = reader1;
int bookNUm = 0, readerNUm = 0, mangerNUm = 0;
while (book != NULL)
{
bookNUm++;
book = book->next;
}
while (reader != NULL)
{
readerNUm++;
reader = reader->next;
}
printf("本图书馆共有藏书%d本,读者%d人\n", bookNUm, readerNUm);
printf("按任意键返回\n");
getchar();
return;
}
```
@ -204,7 +223,7 @@ void ShowMainMenu()
针对概要设计
C2:void ShowLibInfo(const Book* book, const Reader* reader);\\查询图书馆的总信息
![C2](c2.svg)
C3:void ShowLibBook(Book* book);\\查询图书馆藏书信息
C4:Book* AddBook(Book* book);\\存入新书

128
c2.svg

@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created by Flowgorithm 3.4.2 (http://flowgorithm.org) -->
<svg xmlns:svg="http://www.w3.org/2000/svg" xmlns="http://www.w3.org/2000/svg" version="1.1" width="2196" height="3996">
<rect x="0" y="0" width="2196" height="3996" fill="#FFFFFF"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,288 828,375"/>
<polygon fill="#404040" stroke="none" points="828,396 848,361 807,361"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,3600 828,3687"/>
<polygon fill="#404040" stroke="none" points="828,3708 848,3673 807,3673"/>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="5" stroke-dasharray="none" d="M 684,144 A 72 72, 0, 0 0, 684 288 L 972,288 A 72 72, 0, 0 0, 972 144 Z"/>
<text x="828" y="165" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">&#24320;&#22987;</tspan>
</text>
</g>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="5" stroke-dasharray="none" d="M 684,3708 A 72 72, 0, 0 0, 684 3852 L 972,3852 A 72 72, 0, 0 0, 972 3708 Z"/>
<text x="828" y="3729" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">End</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,648 828,735"/>
<polygon fill="#404040" stroke="none" points="828,756 848,721 807,721"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,900 828,987"/>
<polygon fill="#404040" stroke="none" points="828,1008 848,973 807,973"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,1152 828,1239"/>
<polygon fill="#404040" stroke="none" points="828,1260 848,1225 807,1225"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,1404 828,1527"/>
<polygon fill="#404040" stroke="none" points="828,1548 848,1513 807,1513"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,1692 828,2319"/>
<polygon fill="#404040" stroke="none" points="828,2340 848,2305 807,2305"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,2484 828,3075"/>
<polygon fill="#404040" stroke="none" points="828,3096 848,3061 807,3061"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 396,396 L 396,648 L 1260,648 L 1260,396 Z"/>
<polyline fill="none" stroke="#602020" stroke-width="5" stroke-dasharray="none" points="396,432 1260,432"/>
<polyline fill="none" stroke="#602020" stroke-width="5" stroke-dasharray="none" points="432,396 432,648"/>
<text x="846" y="453" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="846" dy="72" unicode-bidi="embed">Integer Book*book=book1</tspan>
<tspan x="846" dy="72" unicode-bidi="embed"> Reader*reader=reader1</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="5" stroke-dasharray="none" d="M 576,756 L 576,900 L 1080,900 L 1080,756 Z"/>
<text x="828" y="777" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">bookNUm = 0</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="5" stroke-dasharray="none" d="M 540,1008 L 540,1152 L 1116,1152 L 1116,1008 Z"/>
<text x="828" y="1029" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">readerNUm = 0</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="5" stroke-dasharray="none" d="M 540,1260 L 540,1404 L 1116,1404 L 1116,1260 Z"/>
<text x="828" y="1281" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">mangerNUm = 0</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1152,1620 1548,1620 1548,1743"/>
<polygon fill="#404040" stroke="none" points="1548,1764 1568,1729 1527,1729"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1548,2052 1548,2160 900,2160 900,1712"/>
<polygon fill="#404040" stroke="none" points="900,1692 879,1726 920,1726"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 1188,1764 L 1044,2052 L 1908,2052 L 2052,1764 Z"/>
<text x="1548" y="1785" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1548" dy="72" unicode-bidi="embed">Output readerNUm</tspan>
<tspan x="1548" dy="72" unicode-bidi="embed">++;&#13;</tspan>
<tspan x="1548" dy="72" unicode-bidi="embed">reader=reader-&gt;next;</tspan>
</text>
</g>
<g>
<path fill="#FFE0A0" stroke="#A08040" stroke-width="5" stroke-dasharray="none" d="M 576,1548 L 504,1620 L 576,1692 L 1080,1692 L 1152,1620 L 1080,1548 Z"/>
<text x="828" y="1569" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">reader!=NULL</tspan>
</text>
</g>
<text x="1260" y="1497" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1260" dy="72" unicode-bidi="embed">True</tspan>
</text>
<text x="702" y="1713" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="702" dy="72" unicode-bidi="embed">False</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1152,2412 1548,2412 1548,2535"/>
<polygon fill="#404040" stroke="none" points="1548,2556 1568,2521 1527,2521"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1548,2844 1548,2952 900,2952 900,2504"/>
<polygon fill="#404040" stroke="none" points="900,2484 879,2518 920,2518"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 1188,2556 L 1044,2844 L 1908,2844 L 2052,2556 Z"/>
<text x="1548" y="2577" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1548" dy="72" unicode-bidi="embed">Output readerNUm</tspan>
<tspan x="1548" dy="72" unicode-bidi="embed">++;&#13;</tspan>
<tspan x="1548" dy="72" unicode-bidi="embed">reader=reader-&gt;next;</tspan>
</text>
</g>
<g>
<path fill="#FFE0A0" stroke="#A08040" stroke-width="5" stroke-dasharray="none" d="M 576,2340 L 504,2412 L 576,2484 L 1080,2484 L 1152,2412 L 1080,2340 Z"/>
<text x="828" y="2361" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">reader!=NULL</tspan>
</text>
</g>
<text x="1260" y="2289" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1260" dy="72" unicode-bidi="embed">True</tspan>
</text>
<text x="702" y="2505" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="702" dy="72" unicode-bidi="embed">False</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 396,3096 L 144,3600 L 1260,3600 L 1512,3096 Z"/>
<text x="828" y="3117" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="828" dy="72" unicode-bidi="embed">Output printf</tspan>
<tspan x="828" dy="72" unicode-bidi="embed">(&quot;&#26412;&#22270;&#20070;&#39302;&#20849;&#26377;&#34255;&#20070;%d&#26412;,</tspan>
<tspan x="828" dy="72" unicode-bidi="embed">&#35835;&#32773;%d&#20154;\n&quot;, bookNUm,</tspan>
<tspan x="828" dy="72" unicode-bidi="embed"> readerNUm);&#13;</tspan>
<tspan x="828" dy="72" unicode-bidi="embed">printf</tspan>
<tspan x="828" dy="72" unicode-bidi="embed">(&quot;&#25353;&#20219;&#24847;&#38190;&#36820;&#22238;\n&quot;);</tspan>
</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 8.4 KiB

Loading…
Cancel
Save