Medium
Counter Without Globals
Write
add_to(total, n) that returns a new total. Read a line of integers and use the function in a loop to print the running total after each number.Input
One line of integers.
Output
One line.
Sample 1
Input
1 2 3
Output
1 3 6
Sample 2
Input
5
Output
5
Output appears here