fork download
  1.  
  2.  
  3. var
  4. a:array[1..1000] of longint;
  5. b,c:longint;
  6.  
  7. procedure qs(l,r:longint);
  8. var
  9. i,j,x,temp:longint;
  10. begin
  11. x:=a[(l+r) div 2];
  12. i:=l;
  13. j:=r;
  14. while (i<=j) do begin
  15. while (a[i]<x) do i:=i+1;
  16. while (a[j]>x) do j:=j-1;
  17. if (i<=j) then begin
  18. temp:=a[i];
  19. a[i]:=a[j];
  20. a[j]:=temp;
  21. i:=i+1;
  22. j:=j-1;
  23. end;
  24. end;
  25. if (l<j) then qs(l,j);
  26. if (i<r) then qs(i,r);
  27. end;
  28. var c :integer;
  29. begin
  30. Readln(a[c]);
  31. qs (a[c]);
  32. For b := 1 to c do begin
  33. Writeln(a[b]);
  34. End;
  35. 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(28,5) Error: Duplicate identifier "c"
prog.pas(30,11) Warning: Variable "c" does not seem to be initialized
prog.pas(31,9) Error: Wrong number of parameters specified for call to "qs"
prog.pas(35,4) Fatal: There were 2 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