64,281
社区成员
发帖
与我相关
我的任务
分享
#include <iostream>
#include <fstream>
using namespace std;
int main()
{
int temp;
ifstream fin( "data.txt" );
ofstream fout( "results.txt", ios::app );
while( fin >> temp )
fout << temp + 2 << endl;
fin.close();
fout.close();
return 0;
}
ifstream fin( "/tmp/data.txt" );
ofstream fout( "/tmp/results.txt", ios::app );
while( fin >> temp )
fout << temp + 2 << endl;
fin.close();
fout.close();