Untitled
unknown
c_cpp
a year ago
364 B
4
Indexable
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::vector<int> numeri = {1,2,41,37,5,6};
//{1,41,37,5,?,?}
numeri.erase(
std::remove_if(numeri.begin(), numeri.end(), [](int n) { return n % 2 == 0; }),
numeri.end()
);
for(int n: numeri){
std::cout << n << " ";
}
return 0;
}
Editor is loading...
Leave a Comment