题解 | 时间转换

时间转换

https://www.nowcoder.com/practice/c4ae7bcac7f9491b8be82ee516a94899

sec = int(input())
time_units = [3600, 60, 1]
part = []
for t in time_units:
    if sec>=t:
        part.append(str(sec//t))
        sec = sec%t
    else:
        part.append(str(0))
print(' '.join(part))

全部评论

相关推荐

评论
点赞
收藏
分享

创作者周榜

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