Search

35. 백준_Python [2884] 알람 시계

A, B = map(int, input().split()) calcTime = 60 - 45 B_Plus = B + calcTime if B_Plus >= 60: A -= B_Plus // 60 B = B_Plus % 60 else: A -= 1 B = B_Plus if A < 0: A = 24 + A elif A > 24: A = A % 24 print(A, B)
Python
복사
는 틀렸다…
A, B = map(int, input().split()) if B < 45: if A == 0: A = 23 B = B + 60 else : A -= 1 B += 60 print(A,B-45)
Python
복사
간단하게 생각하자~