Simple programming problem that is solvable using vector.
#include <iostream>
#include <vector>
using namespace std;
int main()
{
vector <int> foo = {1,2,3,4,5};
int s = 0;
for (int i = 0; i < 4; i++){
sm += foo[i];
}
cout << foo << '\n';
return 0;
}
Comments
Leave a comment