#include #include int main(){ using namespace std; vector a{1.0, 2.0, 3.0, 4.0, 5.0}; double sum = 0; a[1] = 2.2; for(auto el: a){ cout << el << endl; sum += el; } cout << "Sum = " << sum << endl; // 15.2 return 0; }