C++ STL deque

#include <iostream>
#include <algorithm>
#include <deque>
#include <vector>
#include <functional>
#include <iterator>

using namespace std;


int main()
{
  deque<int> deq1;
  deque<int>::iterator deq_iter1;

  for (int k=0;k<16;k++)
  {
    deq1.push_back(rand());
  }

  for (deq_iter1 = deq1.begin();deq_iter1 != deq1.end();++deq_iter1)
  {
    cout << *deq_iter1 << " ";
  }
  cout << endl;
  cout << "------------------------------"<<endl;

  

  system("pause");
  return 0;
}

posted @ 2019-06-12 21:15  西北逍遥  阅读(201)  评论(0编辑  收藏  举报