home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 2000 June / APC561.ISO / workshop / c / list1.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2000-04-02  |  324 b   |  27 lines

  1. #include <iostream>
  2. #include <string>
  3. #include <list>
  4.  
  5. using namespace std;
  6.  
  7. int main()
  8. {
  9.   string s;
  10.   list<string> l;
  11.  
  12.   while (getline( cin, s ) && s.length()) {
  13.     l.push_back( s );
  14.   }
  15.  
  16.   l.sort();
  17.  
  18.   while (l.size()) {
  19.     cout << l.front() << '\n';
  20.     l.pop_front();
  21.   }
  22.  
  23.   return 0;
  24. }
  25.  
  26.  
  27.