fork download
  1. #include <iostream>
  2. #include <iterator>
  3. #include <numeric>
  4.  
  5. int main() {
  6.  
  7. int arr[5] = {100, 80, 60, 40, 20};
  8.  
  9. std::cout << std::accumulate(arr, std::end(arr), 0) << std::endl;
  10. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
300