Advertisement
Guest User

accumulate

a guest
Nov 22nd, 2019
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.25 KB | None | 0 0
  1. #include <string>
  2. #include <vector>
  3. #include <sstream>
  4. #include <iterator>
  5. #include <numeric>
  6. using namespace std;
  7.  
  8. void main()
  9. {
  10. string s{"1 2 3"};
  11. int i = accumulate(istream_iterator<int>{istringstream{s}}, istream_iterator<int>{}, int{});
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement