/* ID:mingcha1 PROG: test LANG: C++ */ #include <iostream> #include <fstream> #include <string> using namespace std; int main() { ofstream fout ("test.out"); ifstream fin ("test.in"); int a, b; fin >> a >> b; fout << a+b << endl; return 0; }
usaco_tset
最新推荐文章于 2023-12-03 16:21:31 发布
本文提供了一个使用C++进行文件输入输出操作的基本示例。通过此代码片段,可以了解如何利用ifstream和ofstream来从文件中读取数据并写入计算结果到另一个文件。该示例展示了简单的加法运算。
2131

被折叠的 条评论
为什么被折叠?



