#include #include #include char *str = NULL; size_t size; int used[999] = {}; int main() { srand((unsigned)time(NULL)); while (1) { int i = 0; while (used[i]) { i = rand() % 1000; used[i] = 1; } printf("%03d\n", i); fflush(stdout); getline(&str, &size, stdin); if (str[0] == 'u') return 0; } }