www.acmicpc.net/problem/2884

 

2884번: 알람 시계

상근이는 매일 아침 알람을 듣고 일어난다. 알람을 듣고 바로 일어나면 다행이겠지만, 항상 조금만 더 자려는 마음 때문에 매일 학교를 지각하고 있다. 상근이는 모든 방법을 동원해보았지만,

www.acmicpc.net

h,m=map(int, input().split())
0<=h<=23
0<=m<=59

if(0<h and m<45): print(h-1, m-45+60)
elif(0<h and m>=45): print(h, m-45)
elif(h==0 and m>45): print(h, m-45)
elif(h==0 and m<45): print((h-1)+24, m-45+60)
else: print(h, m-45)

+ Recent posts