Exemple d’utilisation de la fonction objet ‘transform()’

Author:

 calcul, vecteur, iterator
{filelink=15278}

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

   int calcul_carre (int value)
   {
       return value*value;
   }

   int main()
   {
     set coll1;
     vector coll2;
     ostream_iterator< int > output( cout, " " );
       //insérer 9 élément dans lee 'set'
       for (int i=1; i<=9; ++i) {
           coll1.insert(i);
       }

	   //Afficher le contenu du 'set'
	   copy(coll1.begin(), coll1.end(), output);

	   cout<
    

Leave a Reply

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