---
# System prepended metadata

title: e340. 差分練習

---

## 題目連結[e340](https://zerojudge.tw/ShowProblem?problemid=e340)
B陣列為A陣列的前綴和，A陣列為B陣列的差分陣列，所以a[i]=b[i]-b[i-1]
``` python=
n = int(input())
b = list(map(int,input().split()))
a = []
for i in range(n):
    if i == 0:
        a.append(b[i])
    else:
        a.append(b[i]-b[i-1])
for i in range(n):
    print(a[i],end= " ")
```
