关于freopen

灌水区

你out文件和输入有什么关系/jk
by VinstaG173 @ 2020-02-14 20:50:37


@[Vexalwig_Goodwcoffin](/user/59388) freopen(“CON”,“r”,stdin)也不行
by zyy121212 @ 2020-02-14 20:52:17


建议发学术
by Thomas_ @ 2020-02-14 20:52:32


system("cls");不能用 换行也坏了
by zyy121212 @ 2020-02-14 20:54:26


@[zhaodonglei](/user/178953) smg…… 发完整代码吧。
by Hexarhy @ 2020-02-14 20:56:57


@[Hilarious_Reality](/user/80049) ``` #include<bits/stdc++.h> #include <windows.h> using namespace std; int n=-1; string s; int l,m; int main() { cout<<" 关于reopen"<<endl; system("pause"); freopen("a.in","r",stdin); freopen("a.in","w",stdout); cin>>n; if(n==-1) { cout<<1<<' '<<1<<' '<<0<<endl; l=1; m=0; } else { cin>>l>>m; } freopen("CON", "r", stdin); freopen("CON", "w", stdout); system("pause"); cin>>s; system("cls"); cout<<" l:"<<l<<" m:"<<m<<endl; }/* fclose(stdin); fclose(stdout); */ ```
by zyy121212 @ 2020-02-14 21:06:11


@[zhaodonglei](/user/178953) 然鹅我不知道qaq
by Hexarhy @ 2020-02-14 21:07:47


@[zhaodonglei](/user/178953) 你在这之前加上 ```fclose(stdin)``` ```fclose(stdout)``` 试试?
by suxxsfe @ 2020-02-14 21:12:33


@[Hilarious_Reality](/user/80049) 。。。$QWQ$
by zyy121212 @ 2020-02-14 21:12:40


@[Thomas_Wade](/user/164432) 我试了。。。
by zyy121212 @ 2020-02-14 21:13:28


| 下一页