0%

C++文件操作之freopen

C++文件操作之freopen

1
2
freopen("xxx.in","r",stdin);	//输入文件
freopen("xxx.out","w",stdout); //输出文件
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
freopen("a+b.in","r",stdin);
freopen("a+b.out","w",stdout);
//以上是模板
int a,b;
cin>>a>>b;
cout<<a+b<<endl;
return 0;
}

-------------本文结束感谢您的阅读-------------
老板你好,讨口饭吃