CHAPTER8-10.cpp
上传用户:fjc899
上传日期:2007-07-03
资源大小:187k
文件大小:1k
- //文件名:CHAPTER8-10.cpp
- #include <iostream>
- #include <list>
- #if _MSC_VER > 1020 // if VC++ version is > 4.2
- using namespace std; // std c++ libs implemented in std
- #endif
- int main( )
- {
- list <int> c1;
- list <int>::iterator c1_Iter;
- c1.push_back( 10 );
- c1.push_back( 20 );
- c1.push_back( 30 );
- cout << "c1 =";
- for ( c1_Iter = c1.begin( ); c1_Iter != c1.end( ); c1_Iter++ )
- cout << " " << *c1_Iter;
- cout << endl;
- c1.reverse( );
- cout << "Reversed c1 =";
- for ( c1_Iter = c1.begin( ); c1_Iter != c1.end( ); c1_Iter++ )
- cout << " " << *c1_Iter;
- cout << endl;
- return 0;
- }