I'm trying to make a program that, given an array of integers, returns all the values resulting from adding vector elements.

For example: for a array A={2,1,3} the output should be {2,3,5,1,3,4,3,5,4,6}

I need to program it iteratively using brute force, I have tried to solve it using several nested for loops, but I have not had succes