//#include "stdafx.h"//vc++6.0加上这一行.
#include
#include
#include
using namespace std;
void main(void){
string str;
fstream iofile("text.txt",ios::out);
if(!iofile){
cout << "Create the file failure...\n";
exit(0);
}
cout << "Enter some strings...\n";
while(1){
getline(cin,str);
if(str=="end") break;
iofile << str << endl;
}
iofile.close();
iofile.open("text.txt",ios::in);
while(!iofile.eof()){
iofile >> str;
cout << str << endl;
}
iofile.close();
}