BOJ | 10950번

송치헌·2021년 6월 11일
0
post-thumbnail

Python 풀이

T = int(input())

for i in range(T):
    a, b = map(int, input().split())
    print(a+b)

for i in range(T) 라고 하면 T만큼 for문을 돌린다고 생각하면 된다.
T = 3 이면 3번 for문을 돌린다.

C++ 풀이

#include <iostream>

using namespace std;

int main() {
    int T;
    cin >> T;
    while (T--) {
    	int A, B;
    	cin >> A >> B;
    	cout << A + B << endl;
    }
}
profile
https://oraange.tistory.com/ 여기에도 많이 놀러와 주세요

0개의 댓글