← Back to archive

Stdle #150 · strings · 2026-11-03

What does this C++ snippet output?

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

#include <iostream>
#include <string>
#include <algorithm>
int main() {
std::string s = "hello";
std::reverse(s.begin(), s.end());
std::cout << s << "\n";
}
Strings
4 attempts left

Answer & explanation