백준 문제풀이
baekjoon - python - 2525
winston1214
2020. 8. 24. 13:52
반응형
https://www.acmicpc.net/problem/2525
2525번: 오븐 시계
첫째 줄에 종료되는 시각의 시와 분을 공백을 사이에 두고 출력한다. (단, 시는 0부터 23까지의 정수, 분은 0부터 59까지의 정수이다. 디지털 시계는 23시 59분에서 1분이 지나면 0시 0분이 된다.)
www.acmicpc.net
# @Author YoungMinKim
# baekjoon
import datetime as dt
h,m = map(int,input().split())
m2 = int(input())
now = str(dt.timedelta(hours=h,minutes=m)+dt.timedelta(minutes = m2))
h=now.split(':')[0]
m=now.split(':')[1]
if len(h)>2:
h = h.split(',')[1].split(' ')[1]
print(int(h),int(m))
반응형