其他分享
首页 > 其他分享> > 牛客华为机试HJ73

牛客华为机试HJ73

作者:互联网

原题传送门

1. 题目描述

2. Solution

import sys
from datetime import datetime

if sys.platform != "linux":
    sys.stdin = open("input/HJ73.txt")


def solve(s):
    end = datetime.strptime(s, "%Y %m %d")
    start = datetime.strptime(s[:4] + "0101", "%Y%m%d")
    diff = end - start
    print(diff.days + 1)


for line in sys.stdin:
    s = line.strip()
    solve(s)

标签:end,start,strptime,datetime,sys,牛客,HJ73,机试,diff
来源: https://www.cnblogs.com/junstat/p/16177285.html