fork download
  1. #include <iostream>
  2. #include <functional>
  3. #include <numeric>
  4. using std::accumulate;
  5. using std::cout;
  6. using std::endl;
  7. using std::multiplies;
  8.  
  9. int main() {
  10. int buffer[] = {1, 2, 3, 4, 5};
  11. int result = accumulate(buffer,
  12. buffer + sizeof(buffer) / sizeof(int),
  13. 1,
  14. multiplies<int>());
  15. cout << result << endl;
  16. return 0;
  17. }
Success #stdin #stdout 0.01s 2724KB
stdin
Standard input is empty
stdout
120