fork(49) download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <iterator>
  4. using namespace std;
  5.  
  6. int main() {
  7. int a[] = {1, 3, 5, 7, 9};
  8. int t = accumulate(begin(a), end(a), 0, plus<int>());
  9. cout << t << endl;
  10. return 0;
  11. }
Success #stdin #stdout 0s 3296KB
stdin
Standard input is empty
stdout
25