Write sum_all(v) to add up every number in the vector and return it. An empty one gives 0.
sum_all({3, 4, 5})→12sum_all({})→0int sum_all(const vector<int> &v)#include <vector>
using namespace std;
int sum_all(const vector<int> &v) {
int total = 0;
// your code here: a range-for that adds each number to total
return total;
}
Run tries the examples. When they look right, Submit.