Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var
- x,max,maxi:longint;
- begin
- max:=0; maxi:=0;
- while not(eof) do
- begin
- readln(x);
- if maxi+x > 0 then begin
- maxi := maxi+x;
- if maxi > max then max:=maxi
- end else maxi:=0;
- end;
- writeln(max);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement