- //文件名:CHAPTER7-2.cpp
- #include <iostream>
- #include <deque>
- #if _MSC_VER > 1020 // if VC++ version is > 4.2
- using namespace std; // std c++ libs implemented in std
- #endif
- int main()
- {
- deque<int> myDeque(10,1);
- int x=0;
- deque<int>::iterator iter;
- for(iter=myDeque.begin(); iter!=myDeque.end();iter++)
- { cout<<"Element "<<x++<<":"<<*iter<<endl;}
- return 1;
- }