← Back to archive

Stdle #178 · modern · 2026-12-01

What does this C++ snippet output?

A past puzzle — fully playable. 4 attempts, hints on wrong guesses.

#include <iostream>
#include <vector>
#include <algorithm>
int main() {
std::vector<int> v = {1, 2, 3, 4};
std::transform(v.begin(), v.end(), v.begin(), [](int x) { return x * 10; });
for (int x : v) std::cout << x << " ";
std::cout << "\n";
}
Modern
4 attempts left

Answer & explanation