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

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