import sys
def isLeapYear(year): # 判断是否为闰年
if year%400==0:
return True
elif year%100!=0 and year%4==0:
return True
else:
return False
if __name__ == "__main__":
LeapYearMonth = [0,31,29,31,30,31,30,31,31,30,31,30,31]
CommonYearMonth = [0,31,28,31,30,31,30,31,31,30,31,30,31]
for line in sys.stdin:
year,day = tuple(map(int,line.split()))
if isLeapYear(year):
monthday = LeapYearMonth
else:
monthday = CommonYearMonth
yyyy = year
mm = 0
while day>monthday[mm]:
day -= monthday[mm]
mm += 1
dd = day
print("{0}-{1:0>2}-{2:0>2}".format(yyyy,mm,dd))
KY222 打印日期
最新推荐文章于 2024-11-03 20:27:08 发布