The rules are as follows:
- Take in a string of integers separated by spaces. Add the first and last numbers, the second and second-last numbers, and so on.
- The program must output the numbers separated by newlines.
- The program must handle negative numbers, but may not handle decimals.
- If an odd amount of integers are inputted, just print the lone integer at the end.
- This is code golf, fewest bytes wins.
Here are some test cases:
> input
output
more output
etc.
-------------------
> 2 2
4
> 1 2 3 4 5 6
7
7
7
> 3 4 2 6
9
6
> 1 2 3 4 5
6
6
3
> -5 3 -8 2
-3
-5