Skip to content

Instantly share code, notes, and snippets.

@saulozitos
Created September 27, 2020 14:18
Show Gist options
  • Select an option

  • Save saulozitos/543587ad1ebb5001027725eff4547b66 to your computer and use it in GitHub Desktop.

Select an option

Save saulozitos/543587ad1ebb5001027725eff4547b66 to your computer and use it in GitHub Desktop.
#include <numeric>
#include <vector>
#include <iostream>
long aVeryBigSum(const std::vector<long> &array)
{
return std::accumulate(array.begin(), array.end(), 0LL);
}
int main()
{
const std::vector<long> array {1000000001, 1000000002, 1000000003, 1000000004, 1000000005};
std::cout << "Sum: " << aVeryBigSum(array) << std::endl;
return 0;
}
@saulozitos
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment