how to find all subsums of vectors in c++ code example Example: sum of vector c++ accumulate(a.begin(), a.end(), 0);