#include
#include
#include
using namespace std;
ifstream& open_file(ifstream &in, const string &file)
{
in.close();
in.clear();
in.open(file.c_str());
return in;
}
int main()
{
set ss;
set ::iterator iter;
ifstream infile;
ofstream ofile;
if ( !open_file(infile, "1.txt") )
{
cerr << "No input file!" << endl;
return EXIT_FAILURE;
}
string textline;
while (getline(infile, textline))
ss.insert(textline);
ofile.open("1.txt");
for(iter=ss.begin();iter!=ss.end();iter++)
ofile<<*iter<
阅读(1709) | 评论(0) | 转发(0) |