how to write a program that reads integers until end-of-file and then prints the maximum sum of consecutive values?
example:
if the input is
27 6 -50 21 -3 14 16 -8 42 33 -21 9
the output is
115
which is the sum of
21 -3 14 16 -8 42 33
example:
if the input is
27 6 -50 21 -3 14 16 -8 42 33 -21 9
the output is
115
which is the sum of
21 -3 14 16 -8 42 33
Comment