← Back to archive

Stdle #124 · containers · 2026-10-08

What does this C++ snippet output?

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

#include <iostream>
#include <map>
int main() {
std::map<int,int> m = {{3,30},{1,10},{2,20}};
for (auto& [k,v] : m) std::cout << k << " ";
std::cout << "\n";
}
Containers
4 attempts left

Answer & explanation