Merge remote-tracking branch 'origin/XZG_AverSumofEveryCourse流程图'

xzg_SortbyScore流程图
Cx330 2 years ago
commit 90d4e390b0

@ -0,0 +1,137 @@
<?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="2232" height="3317">
<rect x="0" y="0" width="2232" height="3317" fill="#FFFFFF"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="496,248 496,323"/>
<polygon fill="#404040" stroke="none" points="496,341 513,310 478,310"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="496,1488 496,3051"/>
<polygon fill="#404040" stroke="none" points="496,3069 513,3038 478,3038"/>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="4" stroke-dasharray="none" d="M 186,124 A 62 62, 0, 0 0, 186 248 L 806,248 A 62 62, 0, 0 0, 806 124 Z"/>
<text x="496" y="142" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="496" dy="62" unicode-bidi="embed">AverSumofEveryCourse</tspan>
</text>
</g>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="4" stroke-dasharray="none" d="M 372,3069 A 62 62, 0, 0 0, 372 3193 L 620,3193 A 62 62, 0, 0 0, 620 3069 Z"/>
<text x="496" y="3087" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="496" dy="62" unicode-bidi="embed">End</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="496,496 496,571"/>
<polygon fill="#404040" stroke="none" points="496,589 513,558 478,558"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="496,744 496,819"/>
<polygon fill="#404040" stroke="none" points="496,837 513,806 478,806"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="496,992 496,1067"/>
<polygon fill="#404040" stroke="none" points="496,1085 513,1054 478,1054"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="496,1240 496,1346"/>
<polygon fill="#404040" stroke="none" points="496,1364 513,1333 478,1333"/>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" d="M 310,341 L 310,496 L 682,496 L 682,341 Z"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="310,372 682,372"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="341,341 341,496"/>
<text x="511" y="390" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="511" dy="62" unicode-bidi="embed">Integer i</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" d="M 310,589 L 310,744 L 682,744 L 682,589 Z"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="310,620 682,620"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="341,589 341,744"/>
<text x="511" y="638" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="511" dy="62" unicode-bidi="embed">Integer j</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 124,837 L 124,992 L 868,992 L 868,837 Z"/>
<polyline fill="none" stroke="#602020" stroke-width="4" stroke-dasharray="none" points="124,868 868,868"/>
<polyline fill="none" stroke="#602020" stroke-width="4" stroke-dasharray="none" points="155,837 155,992"/>
<text x="511" y="886" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="511" dy="62" unicode-bidi="embed">Real sum[COURSE_NUM]</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 124,1085 L 124,1240 L 868,1240 L 868,1085 Z"/>
<polyline fill="none" stroke="#602020" stroke-width="4" stroke-dasharray="none" points="124,1116 868,1116"/>
<polyline fill="none" stroke="#602020" stroke-width="4" stroke-dasharray="none" points="155,1085 155,1240"/>
<text x="511" y="1134" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="511" dy="62" unicode-bidi="embed">Real aver[COURSE_NUM]</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="744,1426 1178,1426 1178,1532"/>
<polygon fill="#404040" stroke="none" points="1178,1550 1195,1519 1160,1519"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1178,2852 1178,2945 558,2945 558,1505"/>
<polygon fill="#404040" stroke="none" points="558,1488 540,1518 575,1518"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1178,1674 1178,1780"/>
<polygon fill="#404040" stroke="none" points="1178,1798 1195,1767 1160,1767"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1178,1922 1178,2369"/>
<polygon fill="#404040" stroke="none" points="1178,2387 1195,2356 1160,2356"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1178,2511 1178,2586"/>
<polygon fill="#404040" stroke="none" points="1178,2604 1195,2573 1160,2573"/>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" d="M 992,1550 L 992,1674 L 1364,1674 L 1364,1550 Z"/>
<text x="1178" y="1568" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1178" dy="62" unicode-bidi="embed">sum[j] = 0</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1426,1860 1736,1860 1736,1966"/>
<polygon fill="#404040" stroke="none" points="1736,1984 1753,1953 1718,1953"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1736,2170 1736,2263 1240,2263 1240,1939"/>
<polygon fill="#404040" stroke="none" points="1240,1922 1222,1952 1257,1952"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 1364,1984 L 1364,2170 L 2108,2170 L 2108,1984 Z"/>
<text x="1736" y="2002" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1736" dy="62" unicode-bidi="embed">sum[j] = sum[j]+stu[i].score</tspan>
<tspan x="1736" dy="62" unicode-bidi="embed">[j]</tspan>
</text>
</g>
<g>
<path fill="#FFE0A0" stroke="#A08040" stroke-width="4" stroke-dasharray="none" d="M 992,1798 L 930,1860 L 992,1922 L 1364,1922 L 1426,1860 L 1364,1798 Z"/>
<text x="1178" y="1816" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1178" dy="62" unicode-bidi="embed">i = 0 to n-1</tspan>
</text>
</g>
<text x="1519" y="1754" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1519" dy="62" unicode-bidi="embed">Next</tspan>
</text>
<text x="1069" y="1940" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1069" dy="62" unicode-bidi="embed">Done</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" d="M 930,2387 L 930,2511 L 1426,2511 L 1426,2387 Z"/>
<text x="1178" y="2405" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1178" dy="62" unicode-bidi="embed">aver[j] = sum[i]/i</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 806,2604 L 682,2852 L 1550,2852 L 1674,2604 Z"/>
<text x="1178" y="2622" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1178" dy="62" unicode-bidi="embed">Output &quot;course %d: sum =</tspan>
<tspan x="1178" dy="62" unicode-bidi="embed"> %.0f,aver = %.0f\n&quot;, j + 1,</tspan>
<tspan x="1178" dy="62" unicode-bidi="embed"> sum[j], aver[j]</tspan>
</text>
</g>
</g>
<g>
<path fill="#FFE0A0" stroke="#A08040" stroke-width="4" stroke-dasharray="none" d="M 310,1364 L 248,1426 L 310,1488 L 682,1488 L 744,1426 L 682,1364 Z"/>
<text x="496" y="1382" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="496" dy="62" unicode-bidi="embed">j = 0 to m-1</tspan>
</text>
</g>
<text x="837" y="1320" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="837" dy="62" unicode-bidi="embed">Next</tspan>
</text>
<text x="387" y="1506" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="387" dy="62" unicode-bidi="embed">Done</tspan>
</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 9.1 KiB

@ -423,12 +423,19 @@ Step 2利用循环输入学生的学号成绩和各科成绩
Step 1:利用for循环给 sum 赋初值为 0 Step 1:利用for循环给 sum 赋初值为 0
Step 2:利用第二重循环重新计算每个学生的总分 Step 2:利用第二重循环重新计算每个学生的总分
Step 3:计算每个学生的平均分 Step 3:计算每个学生的平均分
Step 4:将结果按照学号,总分和平均分的顺序进行输出 Step 4:将结果按照舒徐,总分和平均分的顺序进行输出
![计算每个学生各门课程的总分和平均分](AverSumofEveryStudent.svg) ![计算每个学生各门课程的总分和平均分](AverSumofEveryStudent.svg)
#### AverSumofEveryCourse #### AverSumofEveryCourse
step 1:利用for循环给 sum 赋初值为 0
Step 2:利用第二重循环重新计算每门课程的总分
Step 3:计算每门课程的平均分
tep 4:将结果按照顺序,总分和平均分的顺序进行输出
![计算每门课程的总分和平均分](AverSumofEveryCourse.svg)
#### SortbyScore #### SortbyScore
#### AsSortbyNum #### AsSortbyNum

Loading…
Cancel
Save