본문 바로가기
프로그래밍언어/Code_Practice

[SW Expert Academy] 시각 덧셈

by 스꼬맹이브로 2021. 1. 21.
728x90
반응형
SMALL

*문제의 저작권은 SW Expert에 있습니다.
문제 링크 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5PttaaAZIDFAUq&categoryId=AV5PttaaAZIDFAUq&categoryType=CODE

 

T = int(input())
for test_case in range(1, T + 1):
    hour1, minute1, hour2, minute2 = map(int, input().split(" "))
    time = (hour1+hour2) * 60 + minute1 + minute2
    print("#{} {} {}".format(test_case, (time // 60 if time // 60 < 13 else time // 60 - 12), time % 60))
728x90
반응형
LIST