반응형
출처: www.acmicpc.net/problem/10953
Input
5
1,1
2,3
3,4
9,8
5,2
Output
2
5
7
17
7
콤마(,)를 처리하기 위해서 아래와 같이 scanf 처리
scanf("%d,%d", &a, &b);
[C++] 기본 입출력
기본 입출력 숫자 a, b를 입력받아 a + b를 출력하는 ※ [BOJ] 10950 A + B - 3 #include #include using namespace std; int main(){ int TestCase; cin >> TestCase; while(TestCase--){ int a, b; cin>>..
zoosso.tistory.com
#include <iostream>
#include <cstdio>
using namespace std;
int main(){
int TestCase;
scanf("%d", &TestCase);
while(TestCase--){
int a, b;
scanf("%d,%d", &a, &b);
printf("%d\n", a+b);
}
return 0;
}
반응형
'PS 문제 풀이 > Baekjoon' 카테고리의 다른 글
[BOJ] 백준 2161 카드 1 (0) | 2021.02.28 |
---|---|
[BOJ] 백준 2980 도로와 신호등 (0) | 2021.02.28 |
[BOJ] 백준 1100 하얀칸 (0) | 2021.02.28 |
[BOJ] 백준 10950 A + B - 3 (0) | 2021.02.28 |
[BOJ] 백준 2261 가장 가까운 두 점 (0) | 2021.02.28 |
댓글