#K50167. Cumulative Points Calculator
Cumulative Points Calculator
Cumulative Points Calculator
You are given an integer n representing the number of days and a sequence of n integers, where the i-th integer represents the points earned on day i. Your task is to calculate a cumulative sum array such that the i-th element is given by \(S_i = \sum_{j=1}^{i} a_j\), where \(a_j\) is the points earned on the \(j\)-th day.
Example:
Input: 4 10 20 30 40</p>Output: 10 30 60 100
Write a program that reads the input from standard input and outputs the cumulative sums to standard output, separated by a space.
inputFormat
The first line contains an integer \(n\) specifying the number of days. The second line contains \(n\) space-separated integers representing the points earned each day.
outputFormat
Output a single line containing \(n\) space-separated integers where the \(i\)-th integer is the cumulative sum of the first \(i\) days.
## sample4
10 20 30 40
10 30 60 100