# zerojudge - a004 ## code: ``` import sys for s in sys.stdin: y = int(s.strip()) if (y % 4 == 0 and y % 100 != 0) or (y % 400 == 0): print('閏年') else: print('平年') ``` ## **(知識補給)此題需要用到高階語法-連續IPO:** ### 重要結構: ``` import sys for i in sys.stdin: #程式區塊... #程式區塊... ``` i本身就會讀取輸入不需要額外讀取輸入 ## 思路: 利用連續IPO執行全部程式架構,再藉由stirp()語法存取y,最後條件判斷收尾
×
Sign in
Email
Password
Forgot password
or
Sign in via Google
Sign in via Facebook
Sign in via X(Twitter)
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
Continue with a different method
New to HackMD?
Sign up
By signing in, you agree to our
terms of service
.