   #inc1ude <iostream>

   class String;
   istream& operator>>( istream&, String& );
   ostream& operator<<( ostream&, const String& );

   class String {
   public:
      //  
      //   
      // String strl; // String()
      // String str2( "literal" ); // String( const char* );
      // String str3( str2 ); // String( const String& );

      String();
      String( const char* );
      String( const String& );

      // 
      ~String();

      //  
      // strl = str2
      // str3 = "a string literal"

      String& operator=( const String& );
      String& operator=( const char* );

      //    
      // strl == str2;
      // str3 == "a string literal";

      bool operator==( const String& );
      bool operator==( const char* );

      //     
      // strl[ 0 ] = str2[ 0 ];

      char& operator[]( int );

      //    
      int size() { return _size; }
      char* c_str() { return _string; }

   private:
      int _size;
      char *_string;
}


   //   : String.
 
   //    String
   #inc1ude "String.h"
   //    strcmp()
   #inc1ude <cstring>

   //bool String::operator== (const String &rhs)
   bool //   
   String:: // ,   
   operator== //  :  
   (const String &rhs) //   {
      if ( _size != rhs._size )
         return false;
      return strcmp( _strinq, rhs._string ) ? false : true;
   }

   inline bool String::operator==(const char *s)
   {
      return strcmp( _string, s ) ? false : true;
   }

   // default constructor
   inline String::String()
   {
      _size = 0;
      _string = 0;
   }

   inline String::String( const char *str )
   {
      if ( ! str ) {
        _size = 0; _string = 0;
      }
      else {
         _size = str1en( str );
         _string = new char[ _size + 1 ];
         strcpy( _string, str );
   }

   // copy constructor
   inline String::String( const String &rhs )
   {
      size = rhs._size;
      if ( ! rhs._string )
         _string = 0;
      else {
         _string = new char[ _size + 1 ];
         strcpy( _string, rhs._string );
      }
   }

   inline String::~String() { delete [] _string; }

   inline String& String::operator=( const char *s )
   {
      if ( ! s ) {
        _size = 0;
        delete [] _string;
        _string = 0;
      }
      else {
         _size = str1en( s );
         delete [] _string;
         _string = new char[ _size + 1 ];
         strcpy( _string, s );
      }
      return *this;
   }

   inline String& String::operator=( const String &rhs )
   {
      if ( this != &rhs ) {
         delete [] _string;
         _size = rhs._size;
         if ( ! rhs._string )
            _string = 0;
         else {
           _string = new char[ _size + 1 ];
            strcpy( _string, rhs._string );
        }
      }
      return *this;
   }

   #include <cassert>
   inline char& String::operator[] ( int elem )
   {
      assert( elem >= 0 && elem < _size );
      return _string[ elem ];
   }

	
   #include <iomanip>

   inline istream& operator>>( istream &io, String &s )
   {
      //  : 4096 
      const int limit_string_size = 4096;
      char inBuf[ limit_string_size ];
      // setw()    iostream
      //       limit_string_size-l
      io >> setw( limit_string_size ) >> inBuf;
      s = inBuf; // String::operator=( const char* );
      return io;
   }


   inline ostream& operator<<( ostream& os, const String &s )
   {
      return os << s.c_str();
   }



   #include <iostream>
   #inc1ude "String.h"

   int main() {
      int aCnt = 0, eCnt = 0, iCnt = 0, oCnt = 0, uCnt = 0,
      theCnt = 0, itCnt = 0, wdCnt = 0, notVowel = 0;

      //  "The"  "It"
      //     operator==( const char* )
      String but, the( "the" ), it( "it" );

      // operator>>( ostream&, String& )
      while ( cin >> buf ) {
         ++wdCnt;

         // operator<<( ostream&, const String& )
         cout << buf << ' ';

         if ( wdCnt % 12 == 0 )
            cout << endl;

         // String::operator==( const String& ) and
         // String::operator==( const char* );
         if ( buf == the | | buf == "The" )
           ++theCnt;
         else
         if ( buf == it || buf == "It" )
            ++itCnt;

         // invokes String::s-ize()
         for ( int ix =0; ix < buf.sizeO; ++ix )
         {
            // invokes String:: operator [] (int)
            switch( buf[ ix ] )
            {
               case 'a': case 'A': ++aCnt; break;
               case 'e': case 'E': ++eCnt; break;
               case 'i': case 'I': ++iCnt; break;
               case 'o': case '0': ++oCnt; break;
               case 'u': case 'U': ++uCnt; break;
               default: ++notVowe1; break;
            }
         }
      }

      // operator<<( ostream&, const String& )
      cout << "\n\n"
           << ": " << wdCnt << "\n\n"
           << "the/The: " << theCnt << '\n'
           << "it/It: " << itCnt << "\n\n"
           << ": " < <notVowel << "\n\n"
           << "a: " << aCnt << '\n'
           << "e: " << eCnt << '\n'
           << "i: " << ICnt << '\n'
           << "o: " << oCnt << '\n'
           << "u: " << uCnt << endl;
   }

=============================================================================

   #include <vector>

   class iStack {
   public:
      iStack( int capacity )
         : _stack( capacity ), _top( 0 ) {}

      // bool pop( int &va1ue );
      // boot push( int value );
      //    
      void pop( int &value );
      void push( int value );

      bool full();
      bool empty();
      void display();

      int size();

   private:
      int _top;
      vector< int > _stack;
   };

   // stackExcp.h
   class popOnEmpty { /* ... */ };

   // class pushOnFull { /* ... */ };
   class pushOnFull { 
   public:
      pushOnFull( int i ) : _value( i ) { }
      int value { return _value; }
   private:
      int _value;
   };

   inline int iStack::size() { return _top; };
   inline bool iStack::empty() { return _top ? false : true; }
   inline bool iStack::full() {
      return _top < _stack.size()-l ? false : true;
   }

   //bool iStack::pop( int &top_va1ue ) {
   void iStack::pop( int &top_va1ue ) {
      if ( empty() )
         throw popOnEmpty();
         // return false;

      top_value = _stack[ --_top ];

      cout << "iStack::pop(): " << top_value << endl;
      // return true;
   }

   // bool iStack::push( int value ) {
   void iStack::push( int value ) {

      cout << "iStack::push( " << value << " )\n";

      if ( full() )
         throw pushOnFull( value );
         // return false;

      _stack[ _top++ ] = value;
      // return true;
   }

   void iStack::display() {
      cout << "( " << size() << " )( bot: ";
      for ( int ix = 0; ix < _top; ++ix )
          cout << _stack[ ix ] <<" ";
          cout << " :top )\n";
   }


   #inc1ude <iostream>
   #inc1ude "iStack.h"

   int main() 
   {
      iStack stack( 32 ) ;
      stack.display();
      for ( int ix = 1; ix < 51; ++ix )
      {
          try { // try-   pushOnFull
             if ( ix%2 == 0 )
                  stack.push( ix );

             if ( ix%5 == 0 )
               stack.display();

             if ( ix%10 == 0 ) {
              int dummy;
              stack.pop( dummy ); stack.pop( dummy );
              stack.display();
             }
         }
         catch ( popOnEmpty ) {
            cerr << "trying to push value on a full stack\n";
            return errorCode88;
         }
         // catch ( pusOnFull ) {
         catch ( pusOnFull eObj) {
            // cerr << "trying to pop a value on an empty stack\n";
            // return errorCode89;
            cerr << "trying to push value " << eObj.value()
                 << " on a full stack\n"; 
        }      
   }


==================================================================

   class ilist_item;

   class ilist {
   public:
      //   
      ilist() : _at_front( 0 ),
         _at_end( 0 ), _size( 0 ) {}
      void display( ostream &os = cout );
      ilist_item* init_iter( ilist_item *it = 0 );
      ilist_item* ilist::next_iter()
      // ...
   private:
      ilist_item *_at_front;
      ilist_item *_at_end;
      int _size;
      ilist_item *_current;
      // ...
   };


   class ilist_item {
   public:
      ilist_item( int value, ilist_item *item_to_link_to = 0 );
      int value() { return _value; }
      iilst_item* next() { return _next; }
      void next( ilist_item *link ) { _next = link; }
      void value( int new_value ) { _value = new_value; }
   private:
      int _value;
      ilist_item *_next;
   };


   inline ilist_item* ilist::init_iter( i1ist_item *it )
   {
       return _current = it ? it : _at_front;
   }

   inline ilist_item* ilist::next_iter()
   {
       ilist_item *next = _current
       ? _current = _current->next() : _current;
       return next;
   }

   void ilist::insert_all ( const ilist &rhs ) 
   {
      ilist_item *pt = rhs._at_front;
      while ( pt ) {
         insert_end( pt->value() );
         pt = pt->next();
   }

   inline ilist::ilist( const ilist &rhs ) //  
      : _at_front( 0 ), _at_end( 0 )
   { insert_all ( rhs ); }

   inline ilist& ilist::operator=( const ilist &rhs ) 
   {
      remove_all();
      insert_all( rhs );
      return *this;

   }


   ilist_item *ilist::front() { return _at_front(); }


   inline void ilist::insert( ilist_item *ptr, int value )
   {
      new ilist_item( value, ptr );
      ++_size;
   }

   inline void ilist::bump_down_size() { --_size; }

   inline void ilist::bump_up_size() { ++_size; }

   inline void ilist::insert( ilist_item *ptr, int value )
   {
      if ( !ptr )
         insert_front( value );
      else {
         bump_up_size();
         new ilist_item( value, ptr );
      }
   }


   inline void ilist::insert_front( int value )
   {
      ilist_item *ptr = new ilist_item( value );
      if ( !_at_front )
         _at_front = _at_end = ptr;
      else {
         ptr->next( _at_front );
         _at_front = ptr;
      }
      bump_up_size();
   }

   inline void ilist::insert_end( int value )
   {
      if ( !_at_end )
         _at_end = _at_front = new ilist_item( value );
      else _at_end = new ilist_item( value, _at_end );
         bump_up_s-ize();
   }

   ilist_item* ilist::find( int value )
   {
      ilist_item *ptr = _at_front;
      while ( ptr )
      {
         if ( ptr->value() == value )
           break;
         ptr = ptr->next();
      }
      return ptr;
   }


   void ilist::display( ostream &os )
   {
      os << "\n( " << _size << " )( ";
      ilist_item *ptr = _at_front;
      while ( ptr ) {
         os << ptr->value() << " ";
         ptr = ptr->next();
      }
      os << ")\n";
   }

   inline void ilist::remove_front()
   {
      if ( _at_front ) {
         ilist_item *ptr = _at_front;
         _at_front = _at_front->next();

         // _current      
         if ( _current == ptr )
             _current = _at_front;

        bump_down_size() ;
        delete ptr;
      }
   }

   void ilist::remove_all()
   {
      while ( _at_front )
         remove_front();
      _size = 0;
      _at_front = _at_end = 0;
   }

   int ilist::remove( int value )
   {
      ilist_item *plist = _at_front;
      int elem_cnt = 0;
      while ( plist && plist->value() == value )
      {
         plist = plist->next();
         remove_front();
         ++elem_cnt;
      }
      if ( ! plist )
         return elem_cnt;
         ilist_item *prev = plist;
         plist = plist->next();
         while ( plist ) {
            if ( plist->value() == value ) {
               prev->next( plist->next() );

               if ( _current == plist )
                  _current = prev->next();

               delete plist;
               ++elem_cnt;
               bump_down_size();
               plist = prev->next();
               if ( ! plist ) {
                  _at_end = prev;
                   return elem_cnt;
               }
            }
            else {
              prev = plist;
              plist = plist->next();
      }
      return elem_cnt;
   }

   void ilist::concat( const ilist &i1 )
   {
     i1ist_item *ptr = i1._at_front;
     while ( ptr ) {
        insert_end( ptr->value() );
        ptr = ptr->next();
     }
   }

   void ilist::reverse()
   {
      ilist_item *ptr = _at_front;
      ilist_item *prev = 0;
      _at_front = _at_end;
      _at_end = ptr;
      while ( ptr != _at_front )
      {
         ilist_item *tmp = ptr->next();
         ptr->next( prev );
         prev = ptr;
         ptr = tmp;
      }
      _at_front->next( prev );
   }


   inline ilist_item::ilist_item( int value, ilist_item *item ) : _value( value )
   {
      if ( item )
         _next = 0;
      else {
         _next = item->_next;
         item->_next = this;
      }
   }



   #include <iostream>
   #include "ilist.h"

   int main()
   {
       ilist mylist;
       for ( int ix = 0; ix < 10; ++ix ) {
          mylist.insert_front( ix );
          mylist.insert_end( ix );
       }
       cout << "Ok:  insert_front()  insert_end()\n";
       mylist.display();

       ilist_item *it = mylist.find( 8 );
       cout << "\n"
            << "  8: ?"
            << ( it ? " !\n" : " !\n" );

      mylist.insert( it, 1024 );
      cout << "\n" << "  1024  8\n";

      mylist.display();

      int elem_cnt = mylist.remove( 8 );
      cout << "\n"
           << " " << elem_cnt
           << " ()   8\n";

      mylist.display();

      cout << "\n" << "  \n";

      mylist.remove_front(); mylist.display();

      cout << "\n" << "  \n";

      mylist.remove_all(); mylist.display();

   }


++   239


   #include <iostream>
   #include "ilist.h"

   int main()
   {
       ilist mylist;
       cout << "\n-----------------------------------------------\n"
            << " #1: -   \n"
            << "-----------------------------------------------\n";
       mylist.insert_front( 1 ); mylist.insert_front( 1 );
       mylist.insert_front( 1 );
       my1ist.insert_front( 2 ); mylist.insert_front( 3 );
       my1ist.insert_front( 4 );
       mylist.display();
       int elem_cnt = mylist.remove( 1 );
       cout << "\n" << " " << elem_cnt
            << " ()   1\n";
       mylist.display();
       mylist.remove_all();
       cout << "\n-----------------------------------------------\n"
            << " #2: -   \n"
            << "-----------------------------------------------\n";
       mylist.insert_front( 1 ); mylist.insert_front( 1 );
       mylist.insert_front( 1 );
       mylist.display();
       elem_cnt = mylist.remove( 1 );
       cout << "\n" << " " << elem_cnt
            << " ()   1\n";
       mylist.display();
       mylist.remove_all () ;
       cout << "\n-----------------------------------------------\n"
            << " #3: -    \n"
            << "-----------------------------------------------\n";
       mylist.insert_front( 0 ); mylist.insert_front( 2 );
       mylist.insert_front( 4 );
       mylist.display();
       elem_cnt = mylist.remove( 1 );
       cout << "\n" << " " << elem_cnt
            << " ()   1\n";
       mylist.display();
       mylist.remove_all () ;
       cout << "\n-----------------------------------------------\n"
            << " #4: -      \n"
            << "-----------------------------------------------\n";
       my1ist.insert_front( 1 ); mylist.insert_front( 1 );
       my1ist.insert_front( 1 );
       my1ist.insert_front( 0 ); mylist.insert_front( 2 );
       my1ist.insert_front( 4 );
       mylist.insert_front( 1 ); my1ist.insert_front( 1 );
       mylist.insert_front( 1 );
       mylist.display() ;
       elem_cnt = mylist.remove( 1 );
       out "\n" " " elem nt
   }

}

   #include <iostream>
   #include "ilist.h"

   int main()
   {
      ilist mylist;
      for ( int ix = 0; ix < 10; ++ix )
      { 
         mylist.insert_front( ix ); }
         mylist.display();
         cout << "\n" << " \n";
         mylist.reverse(); mylist.display();
         ilist mylist_too;
         mylist_too.insert_end(0); mylist_too.insert_end(1);
         mylist_too.insert_end(1); mylist_too.insert_end(2);
         mylist_too.insert_end(3); mylist_too.insert_end(5);
         cout << "\n" << "mylist_too:\n";
         mylist_too.display();
         mylist.concat( mylist_too );
         cout << "\n"
              << "mylist  concat  mylist_too:\n";
         mylist.disp1ay();
      }
   }



   #include <iostream>
   #include "ilist.h"

   int main()
   {
      ilist mylist;
      for ( int ix = 0; ix < 10; ++ix ) {
         mylist.insert_front( ix );
         mylist.insert_end( ix );
      }

      cout << "\n" << " init_iter()  next_iter() "
           << "    :\n";

      ilist_item *iter;
      for ( iter = mylist.init_iter(); iter; iter = mylist.next_iter() )
         cout << iter->value() << " ";

      cout << "\n" << "  \n";

      ilist mylist2( mylist );
      mylist.remove_all();

      for ( iter = mylist2.init_iter(); iter; iter = mylist2.next_iter() )
         cout << iter->value() << " ";

      cout << "\n" << "   \n";
      mylist = mylist2;

      for ( iter = mylist.init_iter(); iter; iter = mylist.next_iter() )
         cout << iter->value() << " ";

      cout << "\n";
   }


================================================================================

   template <class elemType>
   class list_item {
   public:
      list_item( elemType value, list_item *item = 0 )
         : _value( value ) 
      {
         if ( !item )
            _next = 0;
         else {
            _next = item->_next;
            item->_next = this;
        }
      }
      elemType value() { return _value; }
      list_item* next() { return _next; }
      void next( list_item *link ) { _next = link; }
      void value( elemType new_value ) { _value = new_value; }
   private:
      elemType _value;
      list_item *_next;
   };

   template <class elemType>
   class list {
   public:
      list()
         : _at_front( 0 ), _at_end( 0 ), _current( 0 ), _size( 0 ) {}
      list( const list& );
      list& operator=( const list& );
      ~list() { remove_all(); }
      void insert ( list_item<elemType> *ptr, elemType value );
      void insert_end( elemType value );
      void insert_front( elemType value );
      void insert_all( const list &rhs );
      int remove( elemType value );
      void remove_front();
      void remove_all();
      list_item<elemType> *find( elemType value );
      list_item<elemType> *next_iter();
      list_item<elemType>* init_iter( list_item<elemType> *it );
      void disp1ay( ostream &os = cout );
      void concat( const list& );
      void reverse ();
      int size() { return _size; }
   private:
      void bump_up_size() { ++_size; }
      void bump_down_size() { --_size; }
      list_item<elemType> *_at_front;
      list_item<elemType> *_at_end;
      list_item<elemType> *_current;
      int _size;
   };

===============================================================

   //   -    
   vector<string,allocator>* retrieve_text()
   {
      string file_name;

      cout << "please enter file name: ";
      cin >> file_name;

      //     ...
      ifstream 1nfile( file_name.c_str(), ios::in );
      if ( ! infile ) {
         cerr << "oops! unable to open file "
              << file_name << " -- bailing out!\n";
         exit( -1 );
      }
      else cout << '\n';

      vector<string, allocator> *1ines_of_text =
         new vector<string, allocator>;
      string textime;

      typedef pair<string::size_type, int> stats;
      stats maxline;
      int linenum = 0;

      while ( getline( infile, textline, '\n' )) {
         cout << "line read: " << textline << '\n';
         
         if ( maxline.first < textline.size() ) {
            maxline.first = textline.size() ;
            maxline.second = linenum;
         }
         lines_of_text->push_back( textline );
         linenum++;
      }
      return lines_of_text;
   }

   typedef pair<short,short> location;
   typedef vector<location> loc;
   typedef vector<string> text;
   typedef pair<text* ,loc*> text_loc;
   text_loc* separate_words( const vector<string> *text_file )
   {
      // words:   
      // locations:      
      //  

      vector<string> *words = new vector<string>;
      vector<location> * locations = new vector<location>;

      short line_pos = 0; //   
      // iterate through each line of text
      for ( ; line_pos < text_file->size(); ++line_pos )
         // textline:  
         // word_pos:   
         short word_pos = 0;
         string textline = (*text_file) [ line_pos ];

         string::size_type pos = 0, prev_pos = 0;

         while (( pos = textline.find_first_of( ' ', pos )) != string::npos )
         {
            //  
            words->push_back(textline.substr( prev_pos, pos - prev_pos ));
             
            //       
            locations->push_back(make_pair( line_pos, word_pos ));
             
            //     
            ++word_pos; prev_pos = ++pos;
         }

         //   
         words->push_back(textline.substr( prev_pos, pos - prev_pos ));
         locations->push_back(make_pair( line_pos, word_pos ));
      }
      return new text_loc( words, locations );
   }

   void filter_text( vector<string> *words, string filter )
   {
      vector<string>::iterator iter = words->begin();
      vector<string>::iterator iter_end = words->end();

      //  filter  ,   
      if ( ! filter.size() )
         filter.insert( 0, "\".," );

      while ( iter != iter_end ) {
         string::size_type pos = 0;

         //    
         while (( pos = (*iter).find_first_of( filter, pos )) != string::npos )
           (*iter).erase(pos,1);
           iter++;
         }
      }
   }

   void strip_caps( vector<string,allocator> *words )
   {
      vector<string,allocator>::iterator iter=words->begin() ;
      vector<string,allocator>::iterator iter_end=words->end() ;

      string caps( "ABCDEFGHIJKLMNOPQRSTUVWXYZ" );

      while ( iter != iter_end ) {
         string::size_type pos = 0;
         while (( pos = (*iter).find_first_of( caps, pos )) != string::npos )
            (*iter)[ pos ] = tolower( (*iter)[pos] );
         ++iter;
      }
   }

   void suffix_text( vector<string,allocator> *words )
   {
      vector<string,allocator>::iterator iter = words->begin(), iter_end = words->end();

      while ( iter != iter_end ) {
         //       
         if ( (*iter).size() <= 3 )
            { ++iter; continue; }
         if ( (*iter)[ (*iter).size()-1 ] == 's' )
            suffix_s( *iter );
            //      
            // ed, ing, 1y
         ++iter;
      }
   }


   //    ++
   #include <algorithm>
   #include <string>
   #include <vector>
   #include <utility>
   #include <map>
   #include <set>
   //   iostream,   
   #include <fstream.h>
   //   
   #include <stddef.h>
   #include <ctype.h>

   // typedef   
   typedef pair<short,short> location;
   typedef vector<location,allocator> loc;
   typedef vector<string,allocator> text;
   typedef pair<text*,loc*> text_loc;

   class TextQuery {
   public:
      TextQuery() { memset( this, 0, sizeof( TextQuery )); }
      static void filter_elements( string felems ) { filt_elems = felems; }
      void query_text();
      void display_map_text();
      void display_text_locations();
      void doit() {
         retrieve_text();
         separate_words();
         filter_text();
         suffix_text();
         strip_caps();
         build_word_map();
      }
   private:
      void retrieve_text();
      void separate_words():
      void filter_text();
      void strip_caps();
      void suffix_textQ;
      void suffix_s( string& );
      void build_word_map();

   private:
      vector<string,allocator> *lines_of_text;
      text_loc *text_locations;
      map< string,loc*,
      less<string>,allocator> *word_map;
      static string filt_elems;
   };

   string TextQuery::filt_elems( "\", ;: !?)(\V" );

   int main()
   {
      TextQuery tq;
      tq.doit();
      tq.query_text();
      tq.display_map_text();
   }

   void TextQuery::retrieve_text()
   {
      string file_name;
      cout << "please enter file name: ";
      cin >> file_name;
   }

==============================================================================

   #include <vector>
   #include <string>
   #include <algorithm>
   #include <iterator>

   //     <iostream>
   #include <iostream.h>

   class GreaterThan {
   public:
      GreaterThan( int size = 6 ) : _size( sz ){}
      int size() { return _size; }
      bool operator()(const string &s1) { return s1.size() > _size; }
   private:
      int _size;
   };

   class PrintElem {
   public:
      PrintElem( int lineLen = 8 ) : _line_length( lineLen ), _cnt( 0 ) {}
      void operator()( const string &elem )
      {
        ++_cnt;
        if ( _cnt % _line_length == 0 )
          { cout << '\n'; }

        cout << elem << " ";
   }
   private:
     int _line_length;
     int _cnt;
   };


   ??????????????
   public:
     bool operator()( const string & s1, const string & s2 )
     { return s1.size() < s2.size(); }
   };

   typedef vector<string, allocator> textwords;

   void process_vocab( vector<textwords, allocator> *pvec )
   {
     if ( ! pvec ) {
        //   
     return;
   }

   vector< string, allocator > texts;
   vector<textwords, allocator>::iterator iter;

   for ( iter = pvec->begin() ; iter != pvec->end(); ++iter )
         copy( (*iter).begin(), (*iter).end(),
         back_inserter( texts ));

   //   texts
   sort( texts.begin(), texts.end() );
   //  ,  
   for_each( texts.begin(), texts.end(), PrintElem() );

   cout << "\n\n"; //    

   //  
   vector<string, allocator>::iterator it;
   it = unique( texts.begin(), texts.end() );
   texts.erase( it, texts.end() );

   // ,  
   for_each( texts.begin(), texts.end(), PrintElem() );
   cout << "\n\n";

   //  
   // stable_sort     
   stable_sort( texts.begin(), texts.end(), LessThan() );
   for_each( texts.begin(), texts.end(), PrintElem() );
   cout << "\n\n";

   //   ,    6
   int cnt = 0;
   //   count -    
   count_if( texts.begin(), texts.end(), GreaterThan(), cnt );
   cout << "Number of words greater than length six are "
        << cnt << endl;
    static string rw[] = { "and", "if", "or", "but", "the" };

   vector<string,allocator> remove_words( rw, rw+5 );
   vector<string, allocator>::iterator it2 = remove_words.begin();
   for ( ; it2 != remove_words.end(); ++it2 )
   {
      int cnt = 0;
      //   count -    
      count( texts.begin(), texts.end(), *it2, cnt );
      cout << cnt << " instances removed: "
           << (*it2) << endl;
      texts.erase( remove(texts.begin(),texts.end(),*it2), texts.end() );
   }
   cout << "\n\n";
   for each( texts.begin(), texts.end(), PrintElem() );
   }

===========================================================================

      ,    
      ,     copy() 
   ostream_iterator:

   #include <string>
   #include <algorithm>
   #include <fstream>
   #include <iterator>

   main()
   {
      string file_name;

      cout << "please enter a file to open: ";
      cin >> file_name;

      if ( file_name.empty() || !cin ) {
        cerr << "unable to read file name\n"; return -1;
      }

      ifstream infile( file_name.c_str());

      if ( !infile ) {
         cerr << "unable to open " << file_name << endl;
         return -2;
      }

      istream_iterator< string > ins( infile ), eos;
      ostream_iterator< string > outs( cout, " " );
      copy( ins, eos, outs );
   }

==============================================================

   class Screen; // 

   class StackScreen {
      int topStack;
      // :    Screen
      Screen *stack;
      void (*handler)();
   };

   class StackScreen {
      int topStack;
      void (*handler)(); //   
??      vector<Screen> stack; //  
   };


   class Screen {
      friend istream& operator>>( istream&, Screen& );
      friend ostream& operator<<( ostream&, const Screen& );
   /*
    * _ screen    _height * _width
    * _cursor     
    * _height  _width -     
    */
   public:
      void home() { _cursor = 0; }
      void move( int, int ) ;
      char get() { return _screen[_cursor]; }
      char get( int, int );
      void checkRange( int, int );
      // ...
   private:
      string _screen;
      string::size_type _cursor;
      // short _height, _width;
      //    (. 13.5)
      static const int _height = 24;
      static const int _width = 80;   
   };

   class LinkScreen {
      Screen window;
      LinkScreen *next;
      LinkScreen *prev;
   };


   #include <iostream>
   ostream& operator<<( ostream& os, const Screen& s )
   {
      // :    _height, _width  _screen
      os << "<" << s._height << "," << s._width << ">";
      os << s._screen;
      return os;
   }
