```c #include <stdio.h> #include <stdlib.h> #include <time.h> int main() { int target, n, guess, count = 0; scanf("%d %d", &target, &n); srand((unsigned)time(NULL)); while (1) { scanf("%d", &guess); count++; if (guess < 0) { printf("game over\n"); break; } else if (guess == target) { if (count == 1) { printf("bingo!\n"); } else if (count <= 3) { printf("lucky you!\n"); } else if (count <= n) { printf("good guess!\n"); } else { printf("game over\n"); } break; } else if (guess > target) { printf("too big\n"); } else { printf("too small\n"); } if (count > n) { printf("game over\n"); break; } } return 0; } ``` [2024-10-30 16:19:09 | AI写代码神器 | 269点数解答]