자료구조&알고리즘/알고리즘
IO_BOJ #10951: A+B -4
StoneSeller
2022. 3. 29. 11:25
https://www.acmicpc.net/problem/10951
이 문제에서는 테스트 케이스의 개수를 제시하지 않고 있다.
따라서 에러가 발생하면 반복문이 끝날 수 있도록 try-except 구문을 활용한다.
import sys
def input():
return sys.stdin.readline().rstrip()
while True:
try:
a, b = map(int, input().split())
print(a+b)
except:
break
728x90