测试代码时经常需要重定向输入输出,下面是一个简单例子。
freopen ("input.txt", "r", stdin);
int n;
cin>>n;
cout<<"n is "<<n<<endl;
测试代码时经常需要重定向输入输出,下面是一个简单例子。
freopen ("input.txt", "r", stdin);
int n;
cin>>n;
cout<<"n is "<<n<<endl;
转载于:https://www.cnblogs.com/yeran/p/10959633.html