A+B – 3
https://www.acmicpc.net/problem/10950
| 시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
|---|---|---|---|---|---|
| 1 초 | 256 MB | 220776 | 128173 | 107780 | 58.299% |
문제
두 정수 A와 B를 입력받은 다음, A+B를 출력하는 프로그램을 작성하시오.
입력
첫째 줄에 테스트 케이스의 개수 T가 주어진다.
각 테스트 케이스는 한 줄로 이루어져 있으며, 각 줄에 A와 B가 주어진다. (0 < A, B < 10)
출력
각 테스트 케이스마다 A+B를 출력한다.
예제 입력 1
5 1 1 2 3 3 4 9 8 5 2
예제 출력 1
2 5 7 17 7
출처
비슷한 문제
- 1000번. A+B
- 1001번. A-B
- 1008번. A/B
- 2558번. A+B – 2
- 10951번. A+B – 4
- 10952번. A+B – 5
- 10953번. A+B – 6
- 10998번. A×B
- 11021번. A+B – 7
- 11022번. A+B – 8
- 15740번. A+B – 9
- 15792번. A/B – 2
알고리즘 분류
통과된 코드
심심해서 리스트로 작성했다.
#include <iostream>
#include <list>
using namespace std;
list <pair<int, int>> tempList;
list <pair<int, int>>::iterator it;
pair<int, int> temp;
int main()
{
int N;
cin >> N;
while (N > 0) {
cin >> temp.first >> temp.second;
tempList.push_back(temp);
N--;
}
for (it = tempList.begin(); it != tempList.end(); it++)
cout << it->first + it->second << "\n";
return 0;
}


![백준 13168번 (내일로 여행, C++, Floyd-Warshall) [BAEKJOON]](https://lycos7560.com/wp-content/uploads/2022/10/boj-og-1-2048x1070-1-1024x535.png)
![백준 2042번 (구간 합 구하기, C++) [BAEKJOON]](https://lycos7560.com/wp-content/uploads/boj-og.png)
![백준 1987번 (알파벳, C++, DFS) / 추가 반례 [BAEKJOON]](https://lycos7560.com/wp-content/uploads/boj-og-1.png)