When the amount of data input and output to make use scanf and printf, than cin, cout much faster
But in C ++ cin, cout speed can be accelerated only need to add a sentence ios :: sync_with_stdio (false);
E.g:
#include<iostream>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cout<<"hello world"<<endl;
}
But the large amount of data, then it is recommended to use printf and scanf input and output, or some places than optimized cin, cout fast