풀이
> EOF 처리에 대해 알아야 한다
> try: & except: 사용법에 대한 이해가 필요하다.
test_case = []
while True:
temp_arr=[]
try:
a, b = map(int,input().split())
temp_arr.append(a)
temp_arr.append(b)
test_case.append(temp_arr)
except:
break
for i in range(len(test_case)):
print(test_case[i][0] + test_case[i][1])
'[코테] Baekjoon 단계별 풀이 > 반복문' 카테고리의 다른 글
[파이썬/Python] 단계별 풀이 / 반복문 파트 함수화 (0) | 2024.07.02 |
---|---|
[파이썬/Python] 백준 10952번 A+B - 5 (0) | 2024.06.29 |
[파이썬/Python] 백준 2439번 별 찍기 - 2 (0) | 2024.06.29 |
[파이썬/Python] 백준 2438번 별 찍기 - 1 (0) | 2024.06.29 |
[파이썬/Python] 백준 11022번 A+B - 8 (0) | 2024.06.28 |