[Python] 백준 - 2525 - 오븐 시계

강주형·2022년 7월 29일
0

백준 알고리즘

목록 보기
1/14
post-thumbnail

https://www.acmicpc.net/problem/2525

# 2525

A, B = map(int, input().split())
C = int(input())

M = (B + C) % 60
A_plus = (B + C) // 60

H = (A + A_plus) % 24

print(H, M)
23 48
25
0 13

조건문 사용한 풀이

# 2525

A, B = map(int, input().split())
C = int(input())

H = (B + C) // 60 # 몇 시간 뒤?

if A+H > 23: # 자정 넘으면
    print(A+H-24, (B+C)%60)
else: # 자정 안 넘으면
    print(A+H, (B+C)%60)
23 48
25
0 13
profile
Statistics & Data Science

0개의 댓글