Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var a: array[1..5]of byte;
- s,t,i,n,max: integer;
- begin
- readln(n);
- for i:=1 to 5 do
- begin
- readln(a[i]);
- s:=s+a[i]
- end;
- max:=s;
- for i:=6 to n do
- begin
- readln(t);
- s:=s-a[i-5]+t;
- if s > max then
- max:=s
- end;
- writeln(max);
- end.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement