c++ vector loop delete

  1. Create a vector of integers.
  2. Populate the vector with some elements.
  3. Use a for loop to iterate through the vector.
  4. Inside the loop, check if the current element meets a certain condition.
  5. If the condition is met, use the erase method of the vector to remove the current element.
  6. Continue iterating through the vector until all elements meeting the condition have been removed.