python
某年某月有幾天
輸入一個年份,輸入一個月份,輸出該年該月有多少天。????????????????????????????????????????????????????????????????????????????????????????????????
a,b=eval(input())
if b==2:
if a%4==0 and a%100!=0 or a%400==0:
print("{}年{}月有29天".format(a,2))
else:
print("{}年{}月有28天".format(a,2))
elif b==1 or 3 or 5 or 7 or 8 or 10 or 12:
print("{}年{}月有31天".format(a,b))
else:
print("{}年{}月有30天".format(a,b))
有個實體一直過不了,也不知道是哪個實體,有大佬看出哪里錯了么,或者有更簡單不出錯的?
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/171480.html
