fork download
  1. program gr10(input,output);
  2. var i,n,p,t : integer;
  3. a : array [1..100000] of integer;
  4.  
  5. begin
  6. p := 1;
  7. readln(n);
  8. for i := 1 to n do read(a[i]);
  9. readln;
  10. for j := 1 to n do
  11. begin
  12. for i := 2 to n do
  13. if (a[i - 1]>0) and (a[i]<0) then
  14. begin
  15. t := a[i - 1];
  16. a[i - 1] := a[i];
  17. a[i] := t;
  18. p := p + 1;
  19. end;end;
  20.  
  21. writeln(p,' ');
  22. writeln(a[1],' ');
  23. writeln(a[n])
  24. 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(10,8) Error: Identifier not found "j"
prog.pas(10,6) Error: Ordinal expression expected
prog.pas(10,6) Error: Illegal counter variable
prog.pas(24,7) Fatal: There were 3 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