Digg StumbleUpon LinkedIn YouTube Flickr Facebook Twitter RSS Reset

Comparer deux rangs d’objets avec l’algorithme ‘equal()’

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

 
#include <iostream>
#include <cassert>
#include <algorithm>
#include <string>
#include
<list>
#include <deque>
#include <vector>
using namespace std;
 
int main()
{
  list<string> liste;
  deque<string> deq;
 
  liste.push_back("AB");
  liste.push_back("BA");
  deq.push_back("AB");
  deq.push_back("BA");
 
  cout << (equal(deq.begin(), deq.end(),liste.begin()));
 
  return 0;
}

No comments yet.

Leave a Comment