#define debug //去掉此句话,重定向部分失效 #include<iostream> #include<cstdio> using namespace std; int main() { #ifdef debug freopen("D:\in.txt","r",stdin); //从in.txt文件输入 freopen("CON","r",stdin); //从控制台读入 freopen("D:\out.txt","w",stdout);//输出到out.txt文件 freopen("CON","w",stdout);//从控制台输出 #endif int a; cin>>a; cout<<a<<endl; fclose(stdin); fclose(stdout);//关闭文件 return 0; }