Skip to content

Commit a73f379

Browse files
committed
[BOJ] 오븐시계 / 브론즈5 / 20분(X) -m "https://www.acmicpc.net/problem/2525"
1 parent 87a4f83 commit a73f379

File tree

1 file changed

+31
-0
lines changed
  • learntosurf/Baekjoon/2_조건문/.cph

1 file changed

+31
-0
lines changed
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# 내 풀이
2+
A, B = map(int, input().split())
3+
C = int(input())
4+
5+
if C < 60:
6+
if B+C >= 60:
7+
print((A+1)%24, B+C-60)
8+
else:
9+
print(A%24, B+C)
10+
elif C == 60:
11+
print(A+1, B)
12+
else:
13+
if B+(C%60) >= 60:
14+
print((A+(C//60)+1)%24, B+(C%60)-60)
15+
else:
16+
print((A+(C//60))%24, B+(C%60))
17+
18+
# 다른 풀이
19+
A, B = map(int, input().split())
20+
C = int(input())
21+
22+
A += C // 60
23+
B += C % 60
24+
25+
if B >= 60:
26+
A += 1
27+
B -= 60
28+
if A >= 24:
29+
A -= 24
30+
31+
print(A,B)

0 commit comments

Comments
 (0)