Skip to content

Commit 27546da

Browse files
authored
Merge pull request #10 from learntosurf/main
soomi jeong / 3월 5주차 / 5문제
2 parents edacfdd + c129593 commit 27546da

File tree

5 files changed

+85
-0
lines changed

5 files changed

+85
-0
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 내 풀이
2+
x = int(input())
3+
y = int(input())
4+
5+
if x > 0 and y > 0 :
6+
print('1')
7+
elif x < 0 and y > 0 :
8+
print('2')
9+
elif x < 0 and y < 0 :
10+
print('3')
11+
else:
12+
print('4')
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)
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# 내 풀이
2+
H, M = map(int, input().split())
3+
4+
if M < 45:
5+
H = H - 1
6+
M = M + 15
7+
if H < 0:
8+
H = 23
9+
else:
10+
M = M - 45
11+
12+
print(H, M)
13+
14+
# 다른 풀이
15+
H,M = map(int,input().split())
16+
17+
if M > 44:
18+
print(H, M-45)
19+
elif M<45 and H>0:
20+
print(H-1,M+15)
21+
else:
22+
print(23,M+15)
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# 내 풀이
2+
import sys
3+
4+
T = int(input())
5+
6+
for i in range(T):
7+
a, b = map(int, sys.stdin.readline().split())
8+
print(a+b)
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# 내 풀이
2+
n = int(input())
3+
4+
sum = 0
5+
for i in range(1, n+1):
6+
sum += i
7+
print(sum)
8+
9+
# 다른 풀이
10+
n = int(input())
11+
12+
print(sum(range(1, n+1)))

0 commit comments

Comments
 (0)