18 lines
246 B
C++
18 lines
246 B
C++
|
#include <list>
|
||
|
|
||
|
int main() {
|
||
|
std::list<int> l;
|
||
|
|
||
|
// Fill List
|
||
|
for (int i = 0; i < 10000000 ; i++) {
|
||
|
l.push_back(i);
|
||
|
}
|
||
|
|
||
|
for ( auto iter = l.begin(); iter != l.end(); iter++ ) {
|
||
|
if ( *iter % 3 == 0 ) {
|
||
|
iter = l.erase( iter );
|
||
|
}
|
||
|
}
|
||
|
|
||
|
}
|