fork download
  1. program ideone;
  2. var n, i, e:integer;
  3. var a array [1..10000] of integer;
  4. begin
  5. e:= 0;
  6. read(n);
  7. for i:=2 to n do begin
  8. if a[i]-a[i-1]>1 then begin
  9. e:= e+1;
  10. a[i]:=a[i]-1;
  11. end;
  12. if a[i-1]-a[i]>1 then begin
  13. e:= e+1;
  14. a[i-1]:=a[i-1]-1;
  15. end;
  16. if a[1]-a[i]>1 then begin
  17. e:= e+1;
  18. end;
  19. a[1]:= a[1]-1;
  20. if a[i]-a[1]>1 then begin
  21. a[i]:= a[i]-1;
  22. e:= e+1;
  23. end;
  24. end;
  25. write(e);
  26. end.
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.pas:3: error: syntax error before `array'
prog.pas: In main program:
prog.pas:8: error: undeclared identifier `a' (first use in this routine)
prog.pas:8: error:  (Each undeclared identifier is reported only once
prog.pas:8: error:  for each routine it appears in.)
stdout
Standard output is empty