fork download
  1. var
  2. a:array[1..1000] of longint;
  3. b,size:longint;
  4.  
  5. procedure qs(l,r:longint);
  6. var
  7.    i,j,x,temp:longint;
  8. begin
  9.    x:=a[(l+r) div 2];
  10.    i:=l;
  11.    j:=r;
  12.    while (i<=j) do begin
  13.       while (a[i]<x) do i:=i+1;
  14.       while (a[j]>x) do j:=j-1;
  15.       if (i<=j) then begin
  16.          temp:=a[i];
  17.          a[i]:=a[j];
  18.          a[j]:=temp;
  19.          i:=i+1;
  20.          j:=j-1;
  21.       end;
  22.    end;
  23.    if (l<j) then qs(l,j);
  24.    if (i<r) then qs(i,r);
  25. end;
  26. begin
  27. Readln(a[size]);
  28. qs(a[size]);
  29.       for b:=1 to size do begin
  30.                 writeln(a[b]);
  31.         end;
  32.        
  33. end.
Compilation error #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty