(구) solved ac class 문제들/class 1

[class 1]백준 A+B - 3(10950번) 풀이 (C++/Python)

isekaipudding 2026. 2. 13. 09:23

문제 : A+B - 3(10950번)(Bronze V)

문제 링크 : https://www.acmicpc.net/problem/10950
출처 : Baekjoon Online Judge

 

A+B 문제와 반복문을 적절하게 혼합하여 사용하면 해결됩니다.

#include <bits/stdc++.h>
 
using namespace std;
 
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int t;
    cin >> t;

    for(int i = 0; i < t; i++) {
        int a, b;
        cin >> a >> b;
        cout << a + b << '\n';
    }
 
    return 0;
}

테스트 케이스 수 t를 입력하고 for문을 t번 정도 반복하여 a + b 연산을 실행합니다.

import sys

input = sys.stdin.readline

T:int = int(input().rstrip())

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