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

bool is_even(int num) {
    return num % 2 == 0;
}

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

    // 使用 std::remove_if() 函数从向量中移除所有偶数
    auto new_end = std::remove_if(numbers.begin(), numbers.end(), is_even);

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

    return 0;
}
