Trier un tableau de ‘double’ avec la méthode ‘sort()’

Author:

 méthode, iterator
Download

#include 
#include 
#include 
using namespace std;

double tabDble[] = { 19.2, 87.4, 33.6, 55.0, 11.5, 42.2 };

int main()
   {  

  cout<<"Tableau en forme initiale: ";
   copy(tabDble, tabDble+6,ostream_iterator(cout," "));
   cout<() );
   //Afficher le résultat de tri
   cout<<"Tableau trié: ";
   for(int j=0; j<6; j++)
      cout << tabDble[j] << ' ';
   cout << endl;
   return 0;
}

Leave a Reply

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