코딩 테스트/백준

[Python] 백준 2525 오븐 시계

위시리 2024. 11. 25. 02:56

 

정답 코드

import sys
input = sys.stdin.readline

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

m += time

while m >= 60 :
    h = h + (m // 60)
    m = m - (m // 60)*60

if h > 23 :
    h = h % 24

print(h, m)