笔记:C++ IO 加速与 freopen 顺序无关
最近在备考 CSP-S2,做如下笔记:
ios::sync_with_stdio、cin.tie、cout.tie 和 freopen 顺序无关。
甚至可以交错书写(但不建议):
ios::sync_with_stdio(0);
freopen("1.in", "r", stdin);
cin.tie(0);
freopen("1.out", "w", stdout);
cout.tie(0);
笔记:C++ IO 加速与 freopen 顺序无关
https://blog.mxdyeah.com/post/cpp-io-sync-freopen-order-independent