Advertisement
pablo7890

Untitled

Jan 19th, 2013
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Pascal 0.21 KB | None | 0 0
  1. var
  2.     x,max,maxi:longint;
  3. begin
  4.     max:=0; maxi:=0;
  5.     while not(eof) do
  6.         begin
  7.             readln(x);
  8.             if maxi+x > 0 then begin
  9.                 maxi := maxi+x;
  10.             if maxi > max then max:=maxi
  11.             end else maxi:=0;
  12.         end;
  13.     writeln(max);
  14. end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement