Post

백준 #10953 A+B – 6

백준 #10953 A+B – 6

아주 쉬운 문제

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <iostream>
#include <cstdio>

using namespace std;

int T;

void consumeBuffer() {
    while(getchar() != '\n') {}
}

int main() {
    cin >> T;
    consumeBuffer();
    for(int i = 0; i < T; i++) {
        int a, b;
        a = (int)getchar() - '0';
        getchar();
        b = (int)getchar() - '0';
        consumeBuffer();
        cout << a + b << '\n';
    }
    return 0;
}
This post is licensed under CC BY 4.0 by the author.