#include <iostream> #include <vector> #include <numeric> using namespace std; int main() { vector<int> v(5); int i, total; for(i=0; i<5; i++) v[i] = i; total = accumulate(v.begin(), v.end(), 0); cout << total; return 0; }