-



- - . 67


___________________________________________________________________

#include <iostream.h>

#include <list>

#include <string>

using namespace std;

//

//

//.

typedef list <string> strList;

typedef list <string> :: iterator strIter;

int main( )

{

strList myList;

//

//

//

myList.insert(myList.end(),first);

myList.insert(myList.end(),second);

myList.insert(myList.end(),third);

myList.insert(myList.end(),fourth);

myList.insert(myList.end(),fifth);

myList.push_front(Head); //

myList.push_back(Tail); //

//

//

for (strIter iter=myList.begin( ); iter !=myList.end(); ++iter)

cout << *iter << endl;

cout << endl; //

//

//

myList.erase(find(myList.begin( ),myList.end( ), third));

//

//

strIter iter = myList.end ( );

--iter;

for (int ix = myList.size( ) ; ix > 0 ; --iter ; --ix )

cout << *iter << endl;

return 0;

}

__________________________________________________________________

, STL .h .

strList strIter , . .

- insert . , ; .