Skip to content

Commit 2f6b006

Browse files
authored
Merge pull request #11 from team-mate-algorithm/jaykxo/week02
Jaykxo/week02
2 parents 455bef1 + ed139c7 commit 2f6b006

File tree

3 files changed

+43
-0
lines changed

3 files changed

+43
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
# 1) 5줄 입력받아 리스트에 저장
5+
lines = []
6+
for _ in range(5):
7+
line = input().strip() # 한 줄 입력받고 개행 제거
8+
lines.append(line)
9+
10+
# 2) 가장 긴 문자열의 길이 구하기
11+
max_len = max(len(line) for line in lines)
12+
13+
# 3) 세로로 읽기: 열을 기준으로 각 줄을 돌며 문자 추가
14+
result = ""
15+
for c in range(max_len): # 열(column) 기준
16+
for r in range(len(lines)): # 행(row) 기준
17+
if c < len(lines[r]): # 해당 줄에 문자가 존재하면
18+
result += lines[r][c]
19+
20+
# 4) 결과 문자열 출력
21+
print(result)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
N = int(input()) # 숫자 개수 입력 받기
5+
num = list(map(int, input().split())) # 숫자 리스트 입력 받기
6+
v = int(input()) # 찾을 숫자 입력 받기
7+
8+
count = 0 # 찾은 숫자 개수 초기화
9+
10+
for i in range(N):
11+
if num[i] == v : # 현재 숫자가 찾는 숫자와 같은지 확인
12+
count += 1 # 같으면 개수 증가
13+
14+
print(count) # 결과 출력 (찾은 숫자의 개수)

jaykxo/week02/10952_A+B-5.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import sys
2+
input = sys.stdin.readline
3+
4+
while True:
5+
a, b = map(int, input().split())
6+
if a == 0 and b == 0: # 종료 조건
7+
break
8+
print(a + b)

0 commit comments

Comments
 (0)