본문 바로가기
problem solving

1976. 시각 덧셈

by ormgm 2019. 9. 10.

t = int(input())

for i in range(t):

    h1,m1,h2,m2 = map(int,input().split())

     

    plus = 0

    m = m1 + m2

    h = h1 + h2

    if m > 59:

        plus = 1

    i

    m = m % 60

    h = h + plus

    if h > 12:

        if h % 12 == 0:

            h = 12

        else: h =h % 12

     

    print('#%d'%(i+1),h,m)

'problem solving' 카테고리의 다른 글

1961. 숫자 배열 회전  (0) 2019.09.12
1970. 쉬운 거스름돈  (0) 2019.09.10
1974. 스도쿠 검증  (0) 2019.09.10
1983. 조교의 성적 매기기  (0) 2019.09.08
1984. 중간 평균값 구하기  (0) 2019.09.08

댓글