#include using namespace std; int main() { std::mt19937 rand2(static_cast(time(nullptr))); std::uniform_int_distribution dist(0, 999); while (1) { int keyNo = dist(rand2); cout << setfill('0') << setw(3); cout << keyNo << endl; string s; cin >> s; if (s == "unlocked") return 0; } }