mons = [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
def get_days(mon, day):
if mon == 1:
return mons[0], day
else:
count = sum(mons[:mon-1])
count = count + day
return mons[mon - 1], count
mon = int(input("請輸入月份:"))
day = int(input("請輸入號數:"))
result = get_days(mon, day)
print("{}月有{}天。".format(mon, result[0]))
print("{}月{}號是該年的第{}天".format(mon, day, result[1]))