c++ 文件读写模板

复制代码
#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;
}
复制代码

 

posted @   chenhuan001  阅读(314)  评论(0编辑  收藏  举报
点击右上角即可分享
微信分享提示