BSSPC '22 P1 - Bubble Tea Tracker

View as PDF

Submit solution


Points: 3
Time limit: 2.0s
Memory limit: 256M

Author:
Problem type

For a hackathon, your team is building an app that tracks the user's spending on bubble tea throughout the month! (In order to improve the financial literacy of high school students, supposedly.)

The user of your app makes N bubble tea purchases, the ith costing xi dollars.

After each purchase, your program must calculate the total the user has spent on bubble tea up until that point.

Constraints

1N100

1xi100

Input Specification

The first line contains a single integer, N.

The next N lines contain one integer each, the ith being xi.

Output Specification

Output N lines containing one integer each, representing the total the user has spent on bubble tea after each of the purchases.

Sample Input

Copy
3
1
2
3

Sample Output

Copy
1
3
6

Explanation

The user makes 3 purchases.

After the first purchase, the user has spent 1 dollar on bubble tea.

After the second purchase, the user has spent 1+2=3 dollars on bubble tea.

After the third purchase, the user has spent 1+2+3=6 dollars on bubble tea.


Comments

There are no comments at the moment.