Add tasks for all the new languages
This commit is contained in:
parent
9dc3c2bb62
commit
bba7bfd280
13208 changed files with 134745 additions and 0 deletions
|
|
@ -0,0 +1,21 @@
|
|||
function bubble_sort(sequence s)
|
||||
object tmp
|
||||
integer changed
|
||||
for j=length(s) to 1 by -1 do
|
||||
changed = 0
|
||||
for i=1 to j-1 do
|
||||
if s[i]>s[i+1] then
|
||||
{s[i],s[i+1],changed} = {s[i+1],s[i],1}
|
||||
end if
|
||||
end for
|
||||
if changed=0 then exit end if
|
||||
end for
|
||||
return s
|
||||
end function
|
||||
|
||||
constant s = {4, 15, "delta", 2, -31, 0, "alfa", 19, "gamma", 2, 13, "beta", 782, 1}
|
||||
|
||||
puts(1,"Before: ")
|
||||
?s
|
||||
puts(1,"After: ")
|
||||
?bubble_sort(s)
|
||||
Loading…
Add table
Add a link
Reference in a new issue