○ 알고리즘, 자료구조/2019 알고리즘
백준 2884 파이썬 알람 시계 / if문 / *단순 산수
0ver-grow
2019. 8. 22. 12:09
반응형
H,M = map(int,input().split())
if 0 <= H <= 23 and 0 <= M <= 59 :
if M - 45 < 0 :
if H-1 < 0 :
H = H+23
else :
H = H-1
M = M + (60-45)
print("%d %d" %(H,M))
elif M - 45 >= 0 :
M = M-45
print("%d %d" %(H,M))
else :
print("%d %d" %(H,M-45))
반응형