조건문을 활용하는 문제.
한 번에 해결.
사실 조건문 따윈 필요 없다. 나머지 및 나눗셈만 써도 풀 수 있다.
H,M=map(int,input().split())
DM=int(input())
H=(H+(DM+M)//60)%24
M=(DM+M)%60
print(H,M)
h,m=map(int,input().split())
m+=int(input())
print((h+m//60)%24,m%60)
-> jcause님의 풀이
DM
이라는 변수를 따로 두지 말고 바로 계산했어도 됐었는데.. 이건 생각 못했다.