ifstream 和 ofstream

怕忘了 存一下

#include <bits/stdc++.h>
using namespace std;
int main() {

	int a, b;
	
	ifstream inf1("1.txt");
	inf1 >> a;
	
	ifstream inf2("2.txt");
	inf2 >> b;
	
	ofstream ouf("output.txt");
	ouf << a + b;
	
    return 0;
}
posted @ 2023-11-13 19:08  Steven24  阅读(16)  评论(0)    收藏  举报