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. end.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
Free Pascal Compiler version 2.2.0 [2009/11/16] for i386
Copyright (c) 1993-2007 by Florian Klaempfl
Target OS: Linux for i386
Compiling prog.pas
prog.pas(27,14) Warning: Variable "size" does not seem to be initialized
prog.pas(28,11) Error: Wrong number of parameters specified for call to "qs"
prog.pas(32,4) Fatal: There were 1 errors compiling module, stopping
Fatal: Compilation aborted
Error: /usr/bin/ppc386 returned an error exitcode (normal if you did not specify a source file to be compiled)
stdout
Standard output is empty