Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Sort-an-integer-array/EGL/sort-an-integer-array-1.egl
Normal file
16
Task/Sort-an-integer-array/EGL/sort-an-integer-array-1.egl
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
program SortExample
|
||||
|
||||
function main()
|
||||
test1 int[] = [1,-1,8,-8,2,-2,7,-7,3,-3,6,-6,9,-9,4,-4,5,-5,0];
|
||||
test1.sort(sortFunction);
|
||||
|
||||
for(i int from 1 to test1.getSize())
|
||||
SysLib.writeStdout(test1[i]);
|
||||
end
|
||||
end
|
||||
|
||||
function sortFunction(a any in, b any in) returns (int)
|
||||
return (a as int) - (b as int);
|
||||
end
|
||||
|
||||
end
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
test1 int[] = [1,-1,8,-8,2,-2,7,-7,3,-3,6,-6,9,-9,4,-4,5,-5,0];
|
||||
RUILib.sort(test1, sortFunction);
|
||||
|
||||
|
||||
function sortFunction(a any in, b any in) returns (int)
|
||||
return ((a as int) - (b as int));
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue