-
Notifications
You must be signed in to change notification settings - Fork 0
/
selection sorting-17.fprg
40 lines (40 loc) · 1.91 KB
/
selection sorting-17.fprg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<?xml version="1.0"?>
<flowgorithm fileversion="3.0">
<attributes>
<attribute name="name" value=""/>
<attribute name="authors" value="CB.EN.U4CYS22017"/>
<attribute name="about" value=""/>
<attribute name="saved" value="2023-01-20 10:51:52 AM"/>
<attribute name="created" value="Q0IuRU4uVTRDWVMyMjAxNzsyMDIyMjNNQVlDMDA1NDsyMDIzLTAxLTIwOzA5OjA1OjExIEFNOzMwNTM="/>
<attribute name="edited" value="Q0IuRU4uVTRDWVMyMjAxNzsyMDIyMjNNQVlDMDA1NDsyMDIzLTAxLTIwOzEwOjUxOjUyIEFNOzI7MzE2MA=="/>
</attributes>
<function name="Main" type="None" variable="">
<parameters/>
<body>
<declare name="x, y, z" type="Integer" array="False" size=""/>
<declare name="n" type="Integer" array="False" size=""/>
<input variable="n"/>
<declare name="no" type="Integer" array="True" size="n"/>
<declare name="i" type="Integer" array="False" size=""/>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<output expression=""no:"" newline="True"/>
<input variable="no[i]"/>
</for>
<for variable="x" start="0" end="n-2" direction="inc" step="1">
<for variable="y" start="x+1" end="n-1" direction="inc" step="1">
<if expression="no[x] > no[y]">
<then>
<assign variable="z" expression="no[x]"/>
<assign variable="no[x]" expression="no[y]"/>
<assign variable="no[y]" expression="z"/>
</then>
<else/>
</if>
</for>
</for>
<for variable="i" start="0" end="n-1" direction="inc" step="1">
<output expression="no[i]" newline="True"/>
</for>
</body>
</function>
</flowgorithm>