Charting a Running Total
A launch dashboard at Kestrel Media charts sign-ups, but not the daily count: it charts the total accumulated so far, so day three's point is everything that arrived on days one, two and three together. A chart like that only ever climbs, which is the point — it answers "how far are we towards the target" rather than "how did today go". The dashboard's headline is the last point on that climbing line: the total at the end of the run.
Task: Print the total number of sign-ups at the end of the run.
Input
The first line holds an integer n, the number of days. Each of the next n lines holds that day's sign-up count, in day order.
Output
One line holding the accumulated total on the final day, as a plain integer.
Example:
Input:
3
10
20
15
Output:
45
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