p = int(input("输入0白表示结束程序,输入其他数字表示继续"))
while p:
year = int(input("请输入年份:"))
month = int(input("请输入月份:"))
day = int(input("请输入号数:"))
def ndays(year,month,day):
msp=[31,28,31,30,31,30,31,31,30,31,30,31]
msr = [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31]
if year%400==0 or (year%100!=0 and year %4==0):
ms=msr
else:
ms=msp
m=0
d=0
for i in range(month-1):
d+=ms[i]
d+=day
return d
print('这一天是这一年的第%s天'%ndays(year,month,day))
p = int(input("输入0白表示结束程序,输入其他数字表示继续"))