#include #include using namespace std; int main() { int n[4], x, y, i, j, k, l, kakcnt = 0, kakutei[4]; #if 0 for (i = 0; i < 10; i++) { n[0] = i; j = 0; k = 1; l = 0; while (j < 9) { while (k <= 3) { if (j != i) { n[k] = j; j++; k++; } else j++; if (j > 9)break; } cout << n[0] << " " << n[1] << " " << n[2] << " " << n[3] << flush; cin >> x >> y; if (x == 4)return 0; l += x + y; if (l > 4) { kakutei[kakcnt] = i; kakcnt++; break; } k = 1; } if (kakcnt >= 4)break; } #endif kakutei[0] = 1; kakutei[1] = 2; kakutei[2] = 3; kakutei[3] = 4; cout << kakutei[0] << " " << kakutei[1] << " " << kakutei[2] << " " << kakutei[3] << flush; cin >> x >> y; if (x == 4)return 0; while (next_permutation(kakutei, kakutei + 4)) { cout << kakutei[0] << " " << kakutei[1] << " " << kakutei[2] << " " << kakutei[3] << flush; cin >> x >> y; if (x == 4)return 0; } return 0; }