본문 바로가기

코딩 테스트/백준

[Python] 백준 2525 오븐 시계

 

정답 코드

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)

'코딩 테스트 > 백준' 카테고리의 다른 글

[Python] 백준 1926 그림  (0) 2024.12.19
[Python] 백준 2798 블랙잭  (0) 2024.12.18
[Python] 백준 2884 알람 시계  (0) 2024.10.29
[Python] 백준 11399 ATM  (0) 2024.10.22
[Python] 백준 1931 회의실 배정  (0) 2024.10.21