标签:TE color begin vector AC int c++ || back
#include <iostream> #include <fstream> #include <iterator> #include <algorithm> #include <vector> #include <string> using namespace std; int main() { ifstream in_file("a.txt"); ofstream out_file("b.txt"); if (!in_file || !out_file) { cout << "unable to open file" << endl; return -1; } istream_iterator<string> is(in_file); istream_iterator<string> eof; vector<string> text; copy(is, eof, back_inserter(text)); sort(text.begin(), text.end()); ostream_iterator<string> os(out_file, " "); copy(text.begin(), text.end(), os); }
essential c++ source code part 1
标签:TE color begin vector AC int c++ || back
原文地址:https://www.cnblogs.com/pfsi/p/9149076.html