Trier les 5 premiers éléments d’une collection avec l’algorithme ‘partial_sort()’

Author:

 deque, iterator
Download


#include 
#include 
#include 
#include 

template 
inline void inserer_elements (T& coll, int first, int last)
{
    for (int i=first; i<=last; ++i) {
        coll.insert(coll.end(),i);
    }
}

using namespace std;

int main()
{
    deque deq;
    ostream_iterator output(cout," ");
    inserer_elements(deq,12,18);
    inserer_elements(deq, 8, 21);

	cout<<"Le contenu du deque: ";
    copy(deq.begin(), deq.end(), output);
    cout<
    

Leave a Reply

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