Mode:
Duration:
1
2
3
4
5
6
7
8
9
10
11
12
#include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::vector<int> v = {1, 2, 3, 4, 5};
std::for_each(v.begin(), v.end(), [](int& n){ n *= 2; });
for (const auto& n : v) {
std::cout << n << ' ';
}
return 0;
}Coding works best on desktop or with an external keyboard.