关于关闭输入输出流同步
  • 板块灌水区
  • 楼主H2O_TX
  • 当前回复6
  • 已保存回复6
  • 发布时间2022/8/10 17:25
  • 上次更新2023/10/27 16:05:08
查看原帖
关于关闭输入输出流同步
228778
H2O_TX楼主2022/8/10 17:25

rt,在关闭输入输出流同步后再使用文件输入输出会出现问题。

例如:

#include<bits/stdc++.h>
using namespace std;

int n;

int main()
{
	ios::sync_with_stdio(false);
	freopen("cai.in","r",stdin);
	freopen("cai.out","w",stdout);
	cin>>n;
	cout<<n*2;
	return 0;
}

这种情况应该怎么解决?

2022/8/10 17:25
加载中...