#include <fstream> using namespace std; int main() { ifstream fin("in.txt"); ofstream fout; fout.open("out.txt"); while(!fin.eof()) { string tmp; fin>>tmp; fout<<tmp<<endl; } fin.close(); fout.close(); return 0; }
原文:http://www.cnblogs.com/chenhuan001/p/5971422.html