set_intersection(): copie les éléments d’un rang1 qui sont présent dans le rang2(Exemple)

Author:

 iterator, set
Download

#include 
#include 
#include 
#include 
using namespace std;

int main()
{
   int tab1[] = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
   int tab2[] = { 4, 5, 11, 17, 18 };
   int tab3[] = { 4, 5, 6, 7,6 , 20 };
   ostream_iterator< int > output( cout, " " );

   //Trouver la taille de chaque tableau
   int taille_tab1=sizeof(tab1)/sizeof(int);
   int taille_tab2=sizeof(tab2)/sizeof(int);
   int taille_tab3=sizeof(tab3)/sizeof(int);

    // Afficher le contenu des tableaux
   copy( tab1, tab1 + taille_tab1, output );
   cout <
    

Leave a Reply

Your email address will not be published. Required fields are marked *