Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const n = 100000;
- var startTime, i, j, k, temp : integer;
- a : array[1..n] of integer;
- begin
- startTime := Milliseconds;
- for k := n downto 1 do
- a[k] := k;
- for i := 1 to n do
- for j := i + 1 to n do
- if a[i] > a[j] then
- begin
- temp := a[i];
- a[i] := a[j];
- a[j] := temp;
- end;
- print(Milliseconds - startTime);
- end.
Advertisement
Add Comment
Please, Sign In to add comment