#include <iostream>
#include <vector>
#include <algorithm> 
using namespace std;

int main()
{
    vector<int> my_nums = {22, 98, 95, 46, 31, 53, 82, 24, 11, 19};

    my_nums.erase(remove_if(my_nums.begin(), my_nums.end(), [](int num) {
        return num % 2 != 0; 
    }), my_nums.end());

    cout << "a: [ ";
    for (int i = 0; i < my_nums.size(); i++)
    {
        cout << my_nums[i] << " ";
    }
    cout << "]" << endl;
    cout << "Expected: [ 22 98 46 82 24 ]" << endl;

    return 0;
}

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: