SearchbyNum

XZL_SearchbyName
xuzilin 2 years ago
parent 7a0a5fb3e7
commit 5f38e8efd5

@ -439,6 +439,12 @@ Step 4:将结果按照舒徐,总分和平均分的顺序进行输出
#### SearchbyNum
Step 1:利用for循环给 i 赋值为 0
Step 2:利用 if 条件判断学号是否一致
Step 3:利用二次循环找出所有符合条件的学生
Step 4:利用if条件语句能否找到该学生
![按学号查找学生成绩并显示查找结果](SearchbyNum.svg)
#### SearchbyName
#### StatisticAnalysis

@ -0,0 +1,195 @@
<?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="2728" height="4712">
<rect x="0" y="0" width="2728" height="4712" fill="#FFFFFF"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,310 558,385"/>
<polygon fill="#404040" stroke="none" points="558,403 575,372 540,372"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,4371 558,4446"/>
<polygon fill="#404040" stroke="none" points="558,4464 575,4433 540,4433"/>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="4" stroke-dasharray="none" d="M 279,124 A 93 93, 0, 0 0, 279 310 L 837,310 A 93 93, 0, 0 0, 837 124 Z"/>
<text x="558" y="142" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="558" dy="62" unicode-bidi="embed">SearchbyNum</tspan>
<tspan x="558" dy="62" unicode-bidi="embed">(Integer n, Integer m)</tspan>
</text>
</g>
<g>
<path fill="#F0E0FF" stroke="#9070A0" stroke-width="4" stroke-dasharray="none" d="M 434,4464 A 62 62, 0, 0 0, 434 4588 L 682,4588 A 62 62, 0, 0 0, 682 4464 Z"/>
<text x="558" y="4482" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="558" dy="62" unicode-bidi="embed">End</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,558 558,633"/>
<polygon fill="#404040" stroke="none" points="558,651 575,620 540,620"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,806 558,881"/>
<polygon fill="#404040" stroke="none" points="558,899 575,868 540,868"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,1054 558,1129"/>
<polygon fill="#404040" stroke="none" points="558,1147 575,1116 540,1116"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,1333 558,1408"/>
<polygon fill="#404040" stroke="none" points="558,1426 575,1395 540,1395"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,1550 558,1656"/>
<polygon fill="#404040" stroke="none" points="558,1674 575,1643 540,1643"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="558,1798 558,3826"/>
<polygon fill="#404040" stroke="none" points="558,3844 575,3813 540,3813"/>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" d="M 310,403 L 310,558 L 806,558 L 806,403 Z"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="310,434 806,434"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="341,403 341,558"/>
<text x="573" y="452" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="573" dy="62" unicode-bidi="embed">Integer number</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" d="M 372,651 L 372,806 L 744,806 L 744,651 Z"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="372,682 744,682"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="403,651 403,806"/>
<text x="573" y="700" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="573" dy="62" unicode-bidi="embed">Integer i</tspan>
</text>
</g>
<g>
<path fill="#FFFFD0" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" d="M 372,899 L 372,1054 L 744,1054 L 744,899 Z"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="372,930 744,930"/>
<polyline fill="none" stroke="#A0A070" stroke-width="4" stroke-dasharray="none" points="403,899 403,1054"/>
<text x="573" y="948" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="573" dy="62" unicode-bidi="embed">Integer j</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 217,1147 L 124,1333 L 899,1333 L 992,1147 Z"/>
<text x="558" y="1165" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="558" dy="62" unicode-bidi="embed">Output Input the number</tspan>
<tspan x="558" dy="62" unicode-bidi="embed"> you want to search:</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 403,1426 L 341,1550 L 713,1550 L 775,1426 Z"/>
<text x="558" y="1444" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="558" dy="62" unicode-bidi="embed">Input %ld</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="806,1736 1364,1736 1364,1842"/>
<polygon fill="#404040" stroke="none" points="1364,1860 1381,1829 1346,1829"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1364,3627 1364,3720 620,3720 620,1815"/>
<polygon fill="#404040" stroke="none" points="620,1798 602,1828 637,1828"/>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1705,2046 1922,2046 1922,2276"/>
<polygon fill="#404040" stroke="none" points="1922,2294 1939,2263 1904,2263"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1922,3472 1922,3596 1412,3596"/>
<polygon fill="#404040" stroke="none" points="1395,3596 1425,3613 1425,3578"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1023,2046 775,2046 775,3596 1315,3596"/>
<polygon fill="#404040" stroke="none" points="1333,3596 1302,3578 1302,3613"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 1364,1860 L 992,2046 L 1364,2232 L 1736,2046 Z"/>
<text x="1364" y="2002" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1364" dy="62" unicode-bidi="embed">stu[i].num == number</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1922,2418 1922,2524"/>
<polygon fill="#404040" stroke="none" points="1922,2542 1939,2511 1904,2511"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1922,2666 1922,3051"/>
<polygon fill="#404040" stroke="none" points="1922,3069 1939,3038 1904,3038"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="1922,3193 1922,3286"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 1767,2294 L 1705,2418 L 2077,2418 L 2139,2294 Z"/>
<text x="1922" y="2312" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1922" dy="62" unicode-bidi="embed">Output \n</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="2170,2604 2356,2604 2356,2710"/>
<polygon fill="#404040" stroke="none" points="2356,2728 2373,2697 2338,2697"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="2356,2852 2356,2945 1984,2945 1984,2683"/>
<polygon fill="#404040" stroke="none" points="1984,2666 1966,2696 2001,2696"/>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 2170,2728 L 2108,2852 L 2542,2852 L 2604,2728 Z"/>
<text x="2356" y="2746" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="2356" dy="62" unicode-bidi="embed">Output %d\t</tspan>
</text>
</g>
<g>
<path fill="#FFE0A0" stroke="#A08040" stroke-width="4" stroke-dasharray="none" d="M 1736,2542 L 1674,2604 L 1736,2666 L 2108,2666 L 2170,2604 L 2108,2542 Z"/>
<text x="1922" y="2560" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1922" dy="62" unicode-bidi="embed">j = 0 to m-1</tspan>
</text>
</g>
<text x="2263" y="2498" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="2263" dy="62" unicode-bidi="embed">Next</tspan>
</text>
<text x="1813" y="2684" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1813" dy="62" unicode-bidi="embed">Done</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 1767,3069 L 1705,3193 L 2077,3193 L 2139,3069 Z"/>
<text x="1922" y="3087" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1922" dy="62" unicode-bidi="embed">Output \n</tspan>
</text>
</g>
<g>
<polygon fill="#FFA0A0" stroke="#A04C4C" stroke-width="4" points="1979,3402 1945,3436 1898,3436 1864,3402 1864,3355 1898,3321 1945,3321 1979,3355"/>
<text x="2123" y="3335" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="2123" dy="62" unicode-bidi="embed">Break</tspan>
</text>
</g>
</g>
<g>
</g>
<ellipse cx="1364" cy="3596" rx="31" ry="31" fill="#C04040" stroke="#602020" stroke-width="4"/>
<text x="1829" y="1940" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="1829" dy="62" unicode-bidi="embed">True</tspan>
</text>
<text x="883" y="1940" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="883" dy="62" unicode-bidi="embed">False</tspan>
</text>
</g>
<g>
<path fill="#FFE0A0" stroke="#A08040" stroke-width="4" stroke-dasharray="none" d="M 372,1674 L 310,1736 L 372,1798 L 744,1798 L 806,1736 L 744,1674 Z"/>
<text x="558" y="1692" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="558" dy="62" unicode-bidi="embed">i = 0 to n-1</tspan>
</text>
</g>
<text x="899" y="1630" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="899" dy="62" unicode-bidi="embed">Next</tspan>
</text>
<text x="449" y="1816" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="449" dy="62" unicode-bidi="embed">Done</tspan>
</text>
</g>
<g>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="713,3937 992,3937 992,4074"/>
<polygon fill="#404040" stroke="none" points="992,4092 1009,4061 974,4061"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="992,4216 992,4340 606,4340"/>
<polygon fill="#404040" stroke="none" points="589,4340 619,4357 619,4322"/>
<polyline fill="none" stroke="#404040" stroke-width="8" stroke-dasharray="none" points="403,3937 155,3937 155,4340 509,4340"/>
<polygon fill="#404040" stroke="none" points="527,4340 496,4322 496,4357"/>
<g>
<path fill="#FFD0D0" stroke="#A07070" stroke-width="4" stroke-dasharray="none" d="M 558,3844 L 372,3937 L 558,4030 L 744,3937 Z"/>
<text x="558" y="3893" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="558" dy="62" unicode-bidi="embed">i == n</tspan>
</text>
</g>
<g>
<path fill="#C04040" stroke="#602020" stroke-width="4" stroke-dasharray="none" d="M 682,4092 L 620,4216 L 1302,4216 L 1364,4092 Z"/>
<text x="992" y="4110" fill="#FFFFFF" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="992" dy="62" unicode-bidi="embed">Output \nNot found!\n</tspan>
</text>
</g>
<g>
</g>
<ellipse cx="558" cy="4340" rx="31" ry="31" fill="#FFD0D0" stroke="#A07070" stroke-width="4"/>
<text x="837" y="3831" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="837" dy="62" unicode-bidi="embed">True</tspan>
</text>
<text x="263" y="3831" fill="#000000" font-family="Arial" font-size="32pt" text-anchor="middle" direction="ltr">
<tspan x="263" dy="62" unicode-bidi="embed">False</tspan>
</text>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 13 KiB

Loading…
Cancel
Save