fork download
  1. program task_5_48;
  2. var n, x, count, max_count, i : integer;
  3. begin
  4. (* your code goes here *)
  5. read(n);
  6. count := 0;
  7. max_count := 0;
  8.  
  9. for i:= 1 to n do begin
  10. read(x);
  11. writeln(x);
  12. if x = 0 then count := count + 1
  13. else begin
  14. if max_count < count then begin
  15. max_count := count;
  16. end;
  17. count := 0
  18. end
  19. end;
  20. writeln('max_count = ', max_count)
  21. end.
Success #stdin #stdout 0s 340KB
stdin
18 1 0 0 0 4 0 0 0 0 0 0  0 4 0 0 0 0 4
stdout
1
0
0
0
4
0
0
0
0
0
0
0
4
0
0
0
0
4
max_count = 7