본문 바로가기
Develop/알고리즘

[백준/Python] Bronze V #7891 Can you add this?

by favorcat 2023. 8. 17.
반응형
 

7891번: Can you add this?

The input contains several test cases. The first line contains and integer t (t ≤ 100) denoting the number of test cases. Then t tests follow, each of them consisiting of two space separated integers x and y (−109 ≤ x, y ≤ 109).

www.acmicpc.net

문제

Given two integers, calculate and output their sum.

입력

The input contains several test cases. The first line contains and integer t (t ≤ 100) denoting the number of test cases. Then t tests follow, each of them consisiting of two space separated integers x and y (−10^9 ≤ x, y ≤ 10^9).

출력

For each test case output output the sum of the corresponding integers.

풀이

n = int(input())
for _ in range(n):
    x,y = map(int, input().split())
    print(x+y)
반응형

Comment