A past puzzle — fully playable. 4 attempts, hints on wrong guesses.
stdle-60.cpp
1#include<iostream>
2#include<string>
3intmain(){
4std::strings=std::string(2,'h')+"i";
5std::cout<<s<<"\n";
6return0;
7}
Conversions
Answer & explanation
Console output
hhi
Why
The fill constructor std::string(2, 'h') creates "hh" (two copies of h), not a string derived from the number 2. Concatenating the literal "i" appends one more character, producing "hhi". This isolates the count-char constructor from numeric conversion confusion.