65,211
社区成员
发帖
与我相关
我的任务
分享
ifstream in_file("d:\\aa.txt");
string word;
vector <string>text;
while(in_file>>word)
text.push_back (word);
for(vector <string>::iterator iter =text.begin ();iter!=text.end ();++iter)
cout <<*iter <<endl;
ofstream o_file("d:\\aa.txt");
o_file.open("d:\\aa.txt", ios_base::trunc | ios_base::out);
for(vector <string>::iterator iter =text.begin ();iter!=text.end ();++iter)
o_file<<*iter;
o_file.close();