[Baekjoon] 2525 오븐시계 python

sorzzzzy·2021년 8월 4일
0

Baekjoon Algorithm

목록 보기
1/46
post-thumbnail

🏷 문제


💡 코드

h, m = map(int,input().split())
t = int(input())

if m+t >= 60:
    h += (m+t)//60
    m = (m+t)%60
    if h >= 24:
        h %= 24
else:
    m += t
print(h,m)

🔑

처음으로 풀었던 알고리즘 문제!
시, 분이 업데이트 되는 시점을 잘 체크해서 처리해주면 아주 쉽게 풀리는 문제이다.

profile
Backend Developer

0개의 댓글