#include #include void print(int pass[]) { for (int i = 0; i < 10; i++) { std::cout << pass[i]; } std::cout << std::endl; } int main() { int pass[] = {0,0,0,0,0,0,0,0,0,0}; int ans = 0; std::string s; print(pass); std::cin >> ans >> s; while (ans != 10) { for (int i = 0; i < 10; i++) { for (int j = 0; j < 10; j++) { int tmp; std::string stmp; pass[i] = j; print(pass); std::cin >> tmp >> stmp; if (stmp == "10") return 0; if (tmp > ans) break; if (tmp < ans) { pass[i] -= 1; break; } } } } return 0; }