// Copyright 2005 Daniel Cer (daniel.cer@cs.colorado.edu) // // This work is licensed under the Creative Commons Attribution-NonCommercial- // ShareAlike License. To view a copy of this license, visit // http://creativecommons.org/licenses/by-nc-sa/2.5/ or send a letter to // Creative Commons, 543 Howard Street, 5th Floor, San Francisco, California, // 94105, USA. #include #include #include #include using namespace std; int main (int argc, char *argv[]) { if (argc != 2) { cerr<<"Usage:\n\t"< items; char *file_name = argv[1]; ifstream istrm(file_name); if (!istrm.good()) { cerr<<"Error: can't open \""<>f, istrm.good(); ) items.push_back(f); // sort them sort(items.begin(), items.end()); // display the sorted items for (vector::iterator iter=items.begin(); iter!=items.end(); iter++) { cout<<*iter<