728x90
9698번: SAHUR & IMSA’
Midhat is a Network Security Engineer, based in Sarajevo. He is assigned to do some important consultation projects around the globe in July and August 2013. It happened that Ramadhan (the fasting month for Muslim) falls during these months for the year 20
www.acmicpc.net
문제 풀이
시간, 분이 케이스마다 입력되는데, 입력된 시간에서 45분 전 시간을 출력해준다.
정답 코드
for i in range(1, int(input()) + 1) :
H, M = map(int, input().split())
if M < 45 :
M += 15
H -= 1
else :
M -= 45
if H == -1 : H = 23
print(f"Case #{i}: {H} {M}")
728x90
'Algorithm > PS' 카테고리의 다른 글
[BOJ/백준] 9713 - Sum of Odd Sequence [python] (0) | 2023.03.27 |
---|---|
[BOJ/백준] 9699 - RICE SACK [python] (0) | 2023.03.27 |
[BOJ/백준] 9635 - Balloons Colors [python] (0) | 2023.03.26 |
[BOJ/백준] 9622 - Cabin Baggage [python] (0) | 2023.03.26 |
[BOJ/백준] 9550 - 아이들은 사탕을 좋아해 [python] (0) | 2023.03.26 |