s = input()D = int(input())for i in range(0, len(s)): if s[i] == ':': H = int(s[0 : i]) M = int(s[i+1 : len(s)]) if (M + D) >= 60 and (H + (M + D) // 60) < 24: M = (M + D) % 60 H = H + (M + D) // 60 if (M + D) >= 60 and (H + (M + D) // 60) >= 24: M = (M + D) % 60 H = (H + (M + D) // 60) % 24 if (M + D) < 60: M = (M + D) % 60 if H < 10: H = '0' + str(H) if M < 10: M = '0' + str(M) print(str(H) + ':' + str(M))
1 回答
慕用2276564
TA贡献4条经验 获得超1个赞
s = input()
D = int(input())
for i in range(0, len(s)):
if s[i] == ':':
H = int(s[0 : i])
M = int(s[i+1 : len(s)])
if (M + D) > 60 and (H + (M + D) // 60) < 24:
H = H + (M + D) // 60
M = (M + D) % 60
elif (M + D) >= 60 and (H + (M + D) // 60) >= 24:
H = (H + (M + D) // 60) % 24
M = (M + D) % 60
elif (M + D) < 60:
M = (M + D) % 60
if H < 10:
H = '0' + str(H)
if M < 10:
M = '0' + str(M)
print(str(H) + ':' + str(M))
break
添加回答
举报
0/150
提交
取消