Summing Rows of a Sales Table
Riverbend Supply runs a handful of shops and pulls their tills into one table each week. Every line of the table is a single shop, and holds what that shop took on each of three trading days, in day order. The regional manager is ranking shops against each other this week, so what she needs is one figure per shop rather than one figure per day.
Task: Print each shop's three-day takings, one shop per line, keeping the shops in the order the table lists them.
Input
The first line holds a single integer n, the number of shops. Each of the next n lines holds three sales figures separated by single spaces, in day order. Every figure is a whole number of dollars.
Output
n lines, one per shop, each holding that shop's total as a whole number. No decimal point.
Example:
Input:
2
10 20 30
5 5 5
Output:
60
15
Sign in to solve this problem
Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.
Sign in