Placing Free-Floating Text on a Chart
Pike Street Studio writes the running total straight onto the chart rather than leaving a reader to add the bars up. The text is placed at a chosen spot on the chart's own scale, so it sits inside the plotting area next to the data instead of in a caption below it — a number a reader would otherwise have to work out belongs where they are already looking. The same total is printed as text as well, for anyone reading the output rather than the picture.
Task: Print the total of all the readings as a whole number, with no decimal point. Any fractional part is dropped rather than rounded.
Input
The first line holds an integer n, the number of readings. Each of the next n lines holds one reading, possibly with decimals. n is at least 1.
Output
One line holding a whole number, with no decimal point and no trailing zero.
Example:
Input:
3
10
20
30
Output:
60
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