728x90
반응형
단순 수학 문제이다.
h1, m1, s1 = map(int, input().split(':'))
h2, m2, s2 = map(int, input().split(':'))
t1 = h1*3600 + m1*60 + s1
t2 = h2*3600 + m2*60 + s2
if t1 > t2:
print(t2-t1+3600*24)
else:
print(t2-t1)
h1, m1, s1 = map(int, input().split(':'))
h2, m2, s2 = map(int, input().split(':'))
t1 = h1*3600 + m1*60 + s1
t2 = h2*3600 + m2*60 + s2
print(t2-t1+3600*24 if t1 > t2 else t2-t1)
728x90
반응형
'Agorithm > 백준 알고리즘' 카테고리의 다른 글
백준 알고리즘 15236번 Dominos(python) (0) | 2021.02.07 |
---|---|
백준 알고리즘 15128번 Congruent Numbers(python) (0) | 2021.02.07 |
백준 알고리즘 15059번 Hard choice(python) (0) | 2021.02.07 |
백준 알고리즘 15051번 Máquina de café(python) (0) | 2021.02.07 |
백준 알고리즘 15048번 Jogo de Boca(python) (0) | 2021.02.07 |