#include <iostream>
#include <vector>
#include <algorithm>

int main() {
    std::vector<int> numbers = {1, 2, 3, 2, 4, 2, 5, 2};

    int target = 2;

    // 使用 std::remove() 函数从向量中移除指定元素
    auto new_end = std::remove(numbers.begin(), numbers.end(), target);

    // 输出移除元素后的向量
    std::cout << "Vector after removal: ";
    for (auto it = numbers.begin(); it != new_end; ++it) {
        std::cout << *it << " ";
    }
    std::cout << std::endl;

    return 0;
}
