fork download
  1. program pro10(input,output);
  2. var n,i,j,t;integer;
  3. a: array[1..100000] of integer;
  4. begin
  5. readln(n);
  6. j:=0;
  7. for i:= 1 to n do
  8. read(a[i]);
  9. readln;
  10. for i := 2 to n do
  11. begin
  12. if ( (a[i-1]>0) and (a[i]<0) ) then
  13. begin
  14. j := j+1;
  15. t:= a[i-1];
  16. a[i-1] := a[i];
  17. a[i] := t;
  18. end;
  19. end;
  20. writeln(j,a[1],a[n]);
  21. 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(2,12) Fatal: Syntax error, ":" expected but ";" found
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