문제 : https://www.acmicpc.net/problem/10950

 

풀이과정

두 수를 입력받고 더하는 행위를 테스트케이스만큼 반복한다.

while(tc--) {// tc만큼 while문 반복
    cin>>a>b;
    cout<<a+b;
} 

 


전체코드(C++14)

#include <iostream>
#include <algorithm>
#include <vector>

using namespace std;

int main() {
	int tc;
	cin >> tc;
	while (tc--) {
		int a, b;
		cin >> a >> b;
		cout << a + b << endl;
	}
}