题解 | 计算日期到天数转换

计算日期到天数转换

https://www.nowcoder.com/practice/769d45d455fe40b385ba32f97e7bcded

import sys

a, b, c = map(int, input().split())

total = 0

runyear_day = [31,29,31,30,31,30,31,31,30,31,30,31]
pingyear_day = [31,28,31,30,31,30,31,31,30,31,30,31]

if (a % 4 == 0 and a % 100 != 0) or a % 400 == 0:
    for i in range(b-1):
        total += runyear_day[i]
    total += c
else:
    for k in range(b-1):
        total += pingyear_day[k]
    total += c
print(total)

全部评论

相关推荐

03-07 17:51
已编辑
南华大学 后端工程师
asdasdasda...:也不知道是不是真的被逼呢,也有可能女方有很多东西瞒着男方,这种东西男方什么情况都不知道全靠女方说,很难评的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务