백준 10950_A+B - 3[C++]
본문 바로가기
Algorithm/Python, C++

백준 10950_A+B - 3[C++]

by liveloper jay 2022. 1. 13.

문제

 

풀이

입력받은 두 수의 합을 출력하여 주면 되는 간단한 문제입니다.

소스코드

#include <iostream>
using namespace std;

int main()
{
    int A, B, N;
    cin >> N;
    int result[N];
    for (int i = 0; i < N; i++)
    {
        cin >> A >> B;
        result[i] = A+B;
    }
    
    for (int j = 0; j < N; j++)
    {
        cout << result[j] << endl;
    }
}

'Algorithm > Python, C++' 카테고리의 다른 글

백준 11022_A+B - 8[C++]  (0) 2022.01.13
백준 11021_A+B - 7[C++]  (0) 2022.01.13
백준 10871_X보다 작은 수[C++]  (0) 2022.01.13
백준 8393_합[C++]  (0) 2022.01.13
백준 2742_기찍 N[C++]  (0) 2022.01.10

댓글