#include <iostream>
#include <vector>
int main() {
// Step 1: Declare a vector of integers
std::vector<int> myVector;
// Step 2: Use the fill constructor to initialize the vector with a specified number of elements and a default value
myVector = std::vector<int>(5, 10);
// Step 3: Display the initial contents of the vector
std::cout << "Initial vector elements: ";
for (const auto& element : myVector) {
std::cout << element << " ";
}
std::cout << std::endl;
// Step 4: Use the fill member function to change all elements in the vector to a new value
myVector.fill(20);
// Step 5: Display the updated contents of the vector
std::cout << "Updated vector elements: ";
for (const auto& element : myVector) {
std::cout << element << " ";
}
std::cout << std::endl;
return 0;
}