728x90
반응형
단순 사칙연산 문제이다.
h1, m1, s1 = map(int, input().split(':'))
h2, m2, s2 = map(int, input().split(':'))
t = h2*3600+m2*60+s2 - (h1*3600+m1*60+s1)
if t < 0:
t += 60*60*24
h = t//3600
m = (t%3600)//60
s = t%60
print("%02d:%02d:%02d" % (h,m,s))
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 6367번 Color Me Less(python) (0) | 2021.03.09 |
---|---|
백준 알고리즘 1459번 걷기(python) (0) | 2021.03.09 |
백준 알고리즘 18113번 그르다 김가놈(python) (0) | 2021.03.09 |
백준 알고리즘 4564번 숫자 카드놀이(python) (0) | 2021.03.08 |
백준 알고리즘 4458번 첫 글자를 대문자로(python) (0) | 2021.03.08 |