master
张江楠 1 year ago
parent cf802d85a8
commit 3c15b0194e

@ -371,7 +371,9 @@ void createjz(){//创建邻接矩阵函数
8. Dijkstra()函数是用于计算最佳出行线路和预估费用它使用了Dijkstra算法。 8. Dijkstra()函数是用于计算最佳出行线路和预估费用它使用了Dijkstra算法。
9. main()函数是程序的入口点,它首先初始化地铁站点的数据,然后进入一个循环,等待用户的输入。用户可以选择最佳出行线路推荐或出行费用预估,或者退出系统。 9. main()函数是程序的入口点,它首先初始化地铁站点的数据,然后进入一个循环,等待用户的输入。用户可以选择最佳出行线路推荐或出行费用预估,或者退出系统。
C2:void creatnode()
![C21](images/C21.svg)
![C22](images/C22.svg)
![C2](images/chuangjian.svg) ![C2](images/chuangjian.svg)
C3:void createjz(); C3:void createjz();
![c3](images/printf.svg) ![c3](images/printf.svg)

@ -0,0 +1,159 @@
<?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="2340" height="4392">
<rect x="0" y="0" width="2340" height="4392" fill="#FFFFFF"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,288 612,375"/>
<polygon fill="#404040" stroke="none" points="612,396 632,361 591,361"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,2664 612,4083"/>
<polygon fill="#404040" stroke="none" points="612,4104 632,4069 591,4069"/>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="5" stroke-dasharray="none" d="M 468,144 A 72 72, 0, 0 0, 468 288 L 756,288 A 72 72, 0, 0 0, 756 144 Z"/>
<text x="612" y="165" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">begin</tspan>
</text>
</g>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="5" stroke-dasharray="none" d="M 468,4104 A 72 72, 0, 0 0, 468 4248 L 756,4248 A 72 72, 0, 0 0, 756 4104 Z"/>
<text x="612" y="4125" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">&#32467;&#26463;</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,540 612,627"/>
<polygon fill="#404040" stroke="none" points="612,648 632,613 591,613"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,792 612,879"/>
<polygon fill="#404040" stroke="none" points="612,900 632,865 591,865"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,1044 612,1131"/>
<polygon fill="#404040" stroke="none" points="612,1152 632,1117 591,1117"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,1836 612,1923"/>
<polygon fill="#404040" stroke="none" points="612,1944 632,1909 591,1909"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,2124 612,2211"/>
<polygon fill="#404040" stroke="none" points="612,2232 632,2197 591,2197"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="612,2376 612,2499"/>
<polygon fill="#404040" stroke="none" points="612,2520 632,2485 591,2485"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 396,396 L 396,540 L 828,540 L 828,396 Z"/>
<text x="612" y="417" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">nm.e = 7</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 396,648 L 396,792 L 828,792 L 828,648 Z"/>
<text x="612" y="669" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">nm.n = 7</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 180,900 L 144,936 L 144,1044 L 1080,1044 A 36 72, 0, 0 1, 1080 900 Z"/>
<polyline fill="none" stroke="#602020" stroke-width="5" stroke-dasharray="none" points="180,900 180,936 144,936"/>
<text x="612" y="921" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">&#25171;&#24320;position &quot;rb&quot; &#27169;&#24335;&#35835;&#21462;</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,1296 1044,1296 1044,1491"/>
<polygon fill="#404040" stroke="none" points="1044,1512 1064,1477 1023,1477"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1044,1656 1044,1800 668,1800"/>
<polygon fill="#404040" stroke="none" points="648,1800 682,1820 682,1779"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="396,1296 216,1296 216,1800 555,1800"/>
<polygon fill="#404040" stroke="none" points="576,1800 541,1779 541,1820"/>
<g>
<path fill="#FFD0D0" stroke="#A07070" stroke-width="5" stroke-dasharray="none" d="M 612,1152 L 360,1296 L 612,1440 L 864,1296 Z"/>
<text x="612" y="1245" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">op=NULL</tspan>
</text>
</g>
<g>
<path fill="#D0FFD0" stroke="#70A070" stroke-width="5" stroke-dasharray="none" d="M 756,1512 L 684,1656 L 1332,1656 L 1404,1512 Z"/>
<text x="1044" y="1533" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1044" dy="72" unicode-bidi="embed">&#36755;&#20986; &#25991;&#20214;&#19981;&#23384;&#22312;</tspan>
</text>
</g>
<g>
</g>
<ellipse cx="612" cy="1800" rx="36" ry="36" fill="#FFD0D0" stroke="#A07070" stroke-width="5"/>
<text x="936" y="1173" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="936" dy="72" unicode-bidi="embed">&#30495;</tspan>
</text>
<text x="288" y="1173" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="288" dy="72" unicode-bidi="embed">&#20551;</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="5" stroke-dasharray="none" d="M 396,1944 L 396,2124 L 828,2124 L 828,1944 Z"/>
<polyline fill="none" stroke="#A0A070" stroke-width="5" stroke-dasharray="none" points="396,1980 828,1980"/>
<polyline fill="none" stroke="#A0A070" stroke-width="5" stroke-dasharray="none" points="432,1944 432,2124"/>
<text x="630" y="2001" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="630" dy="72" unicode-bidi="embed">&#25972;&#25968;&#20540; i</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="5" stroke-dasharray="none" d="M 396,2232 L 396,2376 L 828,2376 L 828,2232 Z"/>
<text x="612" y="2253" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">i = 0</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="828,2592 1404,2592 1404,2715"/>
<polygon fill="#404040" stroke="none" points="1404,2736 1424,2701 1383,2701"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1404,3852 1404,3960 684,3960 684,2684"/>
<polygon fill="#404040" stroke="none" points="684,2664 663,2698 704,2698"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1404,2916 1404,3003"/>
<polygon fill="#404040" stroke="none" points="1404,3024 1424,2989 1383,2989"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 1116,2736 L 1116,2916 L 1692,2916 L 1692,2736 Z"/>
<polyline fill="none" stroke="#602020" stroke-width="5" stroke-dasharray="none" points="1116,2772 1692,2772"/>
<polyline fill="none" stroke="#602020" stroke-width="5" stroke-dasharray="none" points="1152,2736 1152,2916"/>
<text x="1422" y="2793" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1422" dy="72" unicode-bidi="embed">&#23383;&#31526;&#20018; strs[100]</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1764,3240 1944,3240 1944,3507"/>
<polygon fill="#404040" stroke="none" points="1944,3528 1964,3493 1923,3493"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1944,3672 1944,3816 1460,3816"/>
<polygon fill="#404040" stroke="none" points="1440,3816 1474,3836 1474,3795"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="1044,3240 864,3240 864,3816 1347,3816"/>
<polygon fill="#404040" stroke="none" points="1368,3816 1333,3795 1333,3836"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 1404,3024 L 1008,3240 L 1404,3456 L 1800,3240 Z"/>
<text x="1404" y="3189" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1404" dy="72" unicode-bidi="embed">op,&quot;%S&quot;,strs!=EOF</tspan>
</text>
</g>
<g>
<path fill="#D0FFD0" stroke="#70A070" stroke-width="5" stroke-dasharray="none" d="M 1764,3528 L 1692,3672 L 2124,3672 L 2196,3528 Z"/>
<text x="1944" y="3549" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1944" dy="72" unicode-bidi="embed">&#36755;&#20986; strs</tspan>
</text>
</g>
<g>
</g>
<ellipse cx="1404" cy="3816" rx="36" ry="36" fill="#C04040" stroke="#602020" stroke-width="5"/>
<text x="1872" y="3117" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1872" dy="72" unicode-bidi="embed">&#30495;</tspan>
</text>
<text x="936" y="3117" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="936" dy="72" unicode-bidi="embed">&#20551;</tspan>
</text>
</g>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="5" stroke-dasharray="none" d="M 468,2520 L 396,2592 L 468,2664 L 756,2664 L 828,2592 L 756,2520 Z"/>
<text x="612" y="2541" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="612" dy="72" unicode-bidi="embed">&#65288;1&#65289;</tspan>
</text>
</g>
<text x="900" y="2469" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="900" dy="72" unicode-bidi="embed">&#30495;</tspan>
</text>
<text x="540" y="2685" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="540" dy="72" unicode-bidi="embed">&#20551;</tspan>
</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 10 KiB

@ -0,0 +1,48 @@
<?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="1404" height="1332">
<rect x="0" y="0" width="1404" height="1332" fill="#FFFFFF"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="432,288 432,411"/>
<polygon fill="#404040" stroke="none" points="432,432 452,397 411,397"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="432,576 432,1023"/>
<polygon fill="#404040" stroke="none" points="432,1044 452,1009 411,1009"/>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="5" stroke-dasharray="none" d="M 288,144 A 72 72, 0, 0 0, 288 288 L 576,288 A 72 72, 0, 0 0, 576 144 Z"/>
<text x="432" y="165" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="432" dy="72" unicode-bidi="embed">&#24320;&#22987;</tspan>
</text>
</g>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="5" stroke-dasharray="none" d="M 288,1044 A 72 72, 0, 0 0, 288 1188 L 576,1188 A 72 72, 0, 0 0, 576 1044 Z"/>
<text x="432" y="1065" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="432" dy="72" unicode-bidi="embed">&#32467;&#26463;</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="720,504 972,504 972,627"/>
<polygon fill="#404040" stroke="none" points="972,648 992,613 951,613"/>
<polyline fill="none" stroke="#404040" stroke-width="9" stroke-dasharray="none" points="972,792 972,900 504,900 504,596"/>
<polygon fill="#404040" stroke="none" points="504,576 483,610 524,610"/>
<g>
<path fill="#D0FFD0" stroke="#70A070" stroke-width="5" stroke-dasharray="none" d="M 756,648 L 684,792 L 1188,792 L 1260,648 Z"/>
<text x="972" y="669" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="972" dy="72" unicode-bidi="embed">&#36755;&#20986; name</tspan>
</text>
</g>
<g>
<path fill="#FFE0A0" stroke="#A08040" stroke-width="5" stroke-dasharray="none" d="M 216,432 L 144,504 L 216,576 L 648,576 L 720,504 L 648,432 Z"/>
<text x="432" y="453" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="432" dy="72" unicode-bidi="embed">i = 0 &#21040; mn</tspan>
</text>
</g>
<text x="864" y="381" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="864" dy="72" unicode-bidi="embed">&#19979;&#19968;&#20010;</tspan>
</text>
<text x="324" y="597" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="324" dy="72" unicode-bidi="embed">&#23436;&#25104;</tspan>
</text>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.9 KiB

Loading…
Cancel
Save