有沒有大佬能告訴我哪錯了
t=0w=1n=int(input())s=[int(x) for x in input().split()]
for i in range(n): w=w-s[i] if w<0: t=t-w*3 w=s[i] elif w>0: t=t+w*2 w=s[i]print(t)
跟我去柬埔寨就告訴你
<3
if w<0: t=t-w*3 w=s[i] elif w>0: t=t+w*2 w=s[i]
w可能為0