What do you mean, garbage values? If it looks like a really big, but single number, then it would be because you're not inserting spaces between the numbers. Try :
cout << sums[l] << endl;
If that still doesn't work, simplify the program until you get an answer, and then add to it.