需要注意的是这里的秒 = 时+分+秒,不是分别转化为时分秒
seconds = int(input()) # seconds = 3661 or seconds = 61 secs = seconds % 60 seconds -= secs hours = seconds // 3600 seconds = seconds - (hours * 3600) mins = seconds // 60 secs = str(secs) mins = str(mins) hours = str(hours) print(hours + " " + mins + " " + secs + " ")

京公网安备 11010502036488号