import datetime def dayofyear(): year = input("請輸入年份:") month = input("請輸入月份:") day = input("請輸入天:") date1 = datetime.date(year=int(year),month=int(month),day=int(day)) date2 = datetime.date(year=int(year),month=1,day=1) return (date1 - date2).days + 1
print(dayofyear())
