본문 바로가기
Python

조건문 연습 - 2884

by soojitasan 2024. 6. 20. 22:40
## 2884 알람 시계
h, m = input().split()
h = int(h)
m = int(m)

if (h*60 + m) < 45:
  h = h + 24
  tm = h*60 + m - 45
  h_new = tm//60
  m_new = tm%60

else:
  tm = h*60 + m - 45
  h_new = tm//60
  m_new = tm%60

print(h_new, m_new)