Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

C++: Insertion des éléments avec la combinaison ‘insert’ et ‘end’

 list, assert, list, deque
{filelink=15006}

 
#include <iostream>
#include <cassert>
#include <algorithm>
#include <string>
#include
<list>
#include <deque>
#include <vector>
using namespace std;
 
int main()
{
  deque<string> deq;
 
  deq.insert(deq.end(), "A");
  deq.insert(deq.end(), "D");
  deq.insert(deq.end(), "Z");
 
  deque<string>::iterator pos;
 
  for (pos=deq.begin(); pos!=deq.end(); ++pos) {
        cout << *pos << ' ';
  }
 
  return 0;
}

No comments yet.

Leave a Comment