C语言 文件输入输出
程序员文章站
2024-03-18 18:07:22
...
输入:freopen(“xxx.txt”,“r”,stdin);
输出:freopen(“xxx.txt”,“w”,stdout);
#include<cstdio>
int main()
{
int n;
freopen("123.txt","r",stdin);
scanf("%d",&n);
freopen("321.txt","w",stdout);
printf("%d",n);
}