Answers for "increase the speed of cin and cout in c++"

C++
0

increase the speed of cin and cout in c++

#include <iostream>

int main(int argc, char **argv) {

  int parity = 0;
  int x;
//you can use scanf , printf alternatively for speed
  std::ios::sync_with_stdio(false);// this increases the speed of i/o

  while (std::cin >> x)
    parity ^= x;
  std::cout << parity << std::endl;

  return 0;
}
Posted by: Guest on October-11-2020

Browse Popular Code Answers by Language