Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
|
|
@ -0,0 +1,20 @@
|
|||
* read data into an array
|
||||
A = table()
|
||||
i = 0
|
||||
readln A<i = i + 1> = trim(input) :s(readln)
|
||||
aSize = i - 1
|
||||
|
||||
* sort array
|
||||
i = 1
|
||||
loop1 value = A<i>
|
||||
j = i - 1
|
||||
loop2 gt(j,0) gt(A<j>,value) :f(done2)
|
||||
A<j + 1> = A<j>
|
||||
j = j - 1 :(loop2)
|
||||
done2 A<j + 1> = value
|
||||
i = ?lt(i,aSize) i + 1 :s(loop1)
|
||||
i = 1
|
||||
|
||||
* output sorted data
|
||||
while output = A<i>; i = ?lt(i,aSize) i + 1 :s(while)
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue