알고리즘

[C++] 백준 15552번 빠른 A+B

J3SUNG 2019. 3. 5. 14:05
728x90

빠른 시간에 문제를 풀어야 합니다.

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;
}