빠른 시간에 문제를 풀어야 합니다.
cin과 cout보다 printf와 scanf가 속도가 빠릅니다.
#include <stdio.h>
#include <iostream>
using namespace std;
int main(int argc, char * argv[])
{
int c=0;
int x, y;
scanf("%d", &c);
for (int i = 0; i < c; i++) {
scanf("%d", &x);
scanf("%d", &y);
printf("%d\n", x + y);
}
return 0;
}
'알고리즘' 카테고리의 다른 글
[C++] 백준 10817번 세 수 (0) | 2019.03.05 |
---|---|
[C++] 백준 9498번 시험 성적 (0) | 2019.03.05 |
[C++] 백준 11721번 열 개씩 끊어 출력하기 (0) | 2019.03.05 |
[C++] 백준 11720번 숫자의 합 (0) | 2019.03.05 |
[C++] 백준 8393번 합 (0) | 2019.03.05 |