C++兼容C的输入输出,即cin与scanf混用文件指针不会出错,cout亦同,导致cin有额外开销。
可以用std::ios::sync_with_stdio(false);手动关闭。
cin.tie(NULL)用于解除cin与cout绑定。
static int x=[](){ std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }();
C++兼容C的输入输出,即cin与scanf混用文件指针不会出错,cout亦同,导致cin有额外开销。
可以用std::ios::sync_with_stdio(false);手动关闭。
cin.tie(NULL)用于解除cin与cout绑定。
static int x=[](){ std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }();
转载于:https://www.cnblogs.com/willaty/p/8478933.html