fork(1) download
  1. pref = [0]
  2. _ = input()
  3. for liczba in map(int, input().split()):
  4. pref.append(pref[-1]+liczba)
  5. print(pref)
Success #stdin #stdout 0.04s 9788KB
stdin
5
2 3 7 8 1
stdout
[0, 2, 5, 12, 20, 21]