把当时的代码放出来,大家共同学习,互相帮助
题目:
输入样例:
123 4577973
输出样例:
12:42:59
代码如下(Python):
lst = list(map(int, input().split()))
total_seconds = int((lst[1] - lst[0])/100+0.5)
hours = str(total_seconds//3600)
if int(hours) < 10:
hours = '0'+str(hours)
modh = total_seconds % 3600
minutes = str(modh // 60)
if int(minutes) < 10:
minutes = '0'+str(minutes)
seconds = str(modh % 60)
if int(seconds) < 10:
seconds = '0'+str(seconds)
print(hours+':'+minutes+':'+seconds)