Created
September 27, 2020 14:18
-
-
Save saulozitos/543587ad1ebb5001027725eff4547b66 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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; | |
| } |
Author
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://godbolt.org/z/7efxn6