C++: Exemple d’utilisation de la fonction ‘accumulate()’ avec la fonction ‘minus()’

Author:

 accumulate
{filelink=15265}

#include 
#include 
#include 
using namespace std;

int main()
{
   double tab[4] = {3, 5, 8, 1}, somme;

   somme = accumulate(tab, tab + 4, 0, minus());
   cout << "somme = " << somme << endl;

   return 0;
}

Leave a Reply

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