Total Daily Steps
Northwind Health ships a fitness band that writes one step count into the device log every hour. At midnight the phone app has to show a single number for the day. The log it is handed is just the raw hourly counts, in the order they were recorded, with nothing added up yet.
Task: Print the day's total step count.
Input
The first line holds a single integer n, the number of hourly readings. Each of the next n lines holds one reading: a whole number of steps. There is always at least one reading.
Output
One line holding the total as a whole number. No decimal point and no thousands separator: 2500, never 2500.0 and never 2,500.
Example:
Input:
3
500
1200
800
Output:
2500
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