X-man

导航

毕业设计小代码

1.按逗号换行。

#include<fstream>
#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s;
    ifstream ci("wa.txt");
    ofstream co("wb.txt",ios::app);
    while(ci>>s)
    {
        //co.put(ci.get());
        co<<s;
        if(s[s.size()-1]==',')
            co<<endl;
    }
    ci.close();
    co.close();
    return 0;
}
View Code

 

posted on 2015-02-27 18:50  雨钝风轻  阅读(396)  评论(0编辑  收藏  举报