[백준] 1408번 : 24 - Python(파이썬)

강재원·2022년 10월 8일
0

[코딩테스트] Python

목록 보기
111/200



https://www.acmicpc.net/problem/1408

a1,b1,c1=input().split(':')
a1=int(a1)
b1=int(b1)
c1=int(c1)
a2,b2,c2=input().split(':')
a2=int(a2)
b2=int(b2)
c2=int(c2)

hour=a2-a1+23
min=b2-b1+59
sec=c2-c1+60

if sec>=60:
    sec-=60
    min+=1
if min>=60:
    min-=60
    hour+=1
if hour>=24:
    hour-=24
print('%02d:%02d:%02d' % (hour,min,sec))
profile
개념정리 & 문법 정리 & 알고리즘 공부

0개의 댓글