문제 : 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)'(구) solved ac class 문제들 > class 1' 카테고리의 다른 글
| [class 1]백준 A+B - 5(10952번) (C++/Python) (0) | 2026.02.15 |
|---|---|
| [class 1]백준 A+B - 4(10951번) 풀이 (C++/Python) (0) | 2026.02.14 |
| [class 1]백준 X보다 작은 수(10871번) 풀이 (C++/Python) (0) | 2026.02.12 |
| [class 1]백준 사칙연산(10869번) 풀이 (C++/Python) (0) | 2026.02.10 |
| [class 1]백준 개(10172번) 풀이 (C++/Python) (0) | 2026.02.09 |