题解 | #百钱买百鸡问题#

计算日期到天数转换

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

def dfx(ipp):
    ip = ipp.split(" ")
    yf = int(ip[1])
    ts = 0
    for _ in range(1,yf):
        if _ == 1:
            ts += 31
        if _ == 2:
            ts += 28
        if _ == 3:
            ts += 31
        if _ == 4:
            ts += 30
        if _ == 5:
            ts += 31
        if _ == 6:
            ts += 30
        if _ == 7:
            ts += 31
        if _ == 8:
            ts += 30
        if _ == 9:
            ts += 31
        if _ == 10:
            ts += 31
        if _ == 11:
            ts += 30
        if _ == 12:
            ts += 31
    if int(ip[0]) % 4== 0:
        ts += 1
    if int(ip[0]) % 100 == 0:
        ts -= 1
    ts += int(ip[2])
              
    return ts
while True:
    try:
        print(dfx(input()))   
    except:
        break

全部评论

相关推荐

回家当保安:复旦✌🏻,佬你的简历感觉挺好的,寒假日常hc比较少。佬可以过完年之后再试试,日常实习hc比较充足
点赞 评论 收藏
分享
程序员花海:实习和校招简历正确格式应该是教育背景+实习+项目经历+个人评价 其中项目经历注意要体现业务 实习经历里面的业务更是要自圆其说 简历模板尽可能保持干净整洁 不要太花哨的
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

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