×
解除綁定,重新設定系統帳號的密碼
您的系統帳號 ID:
您的系統帳號:
您的帳號暱稱:
設定新密碼:
設定新密碼:
×
請輸入要加入的「課程代碼」
請向開設課程的使用者索取「課程代碼」
Problems
Submissions
Rank
Forum
Contest
Login
Register
New Thread
#42099: python AC 解
deansuo1825@gmail.com
(黃昱碩)
School : No School
ID : 256775
×
傳送站內訊息
To:
Subject:
Content:
IP address : []
Last Login :
2023-11-25 09:56:15
g595.
1. 修補圍籬
--
2021年11月
APCS
| From: [218.164.83.239] | Post Date : 2024-09-26 23:19
n=int(input())
j=list(map(int,input().split()))
total=0
for i in range(len(j)):
if i==0:
if j[i]==0:
total+=j[i+1]
elif i==(len(j)-1):
if j[i]==0:
total+=j[i-1]
else:
if j[i]==0:
if j[i+1]>=j[i-1]:
total+=j[i-1]
else:
total+=j[i+1]
print(total)
ZeroJudge Forum