#include #include #include #define MIN 1 #define MAX 100 #define MAX_VERSUCHE 20 using namespace std; int main() { srand(time(NULL)); int gesucht = MIN+rand()%(MAX-MIN+1); cout << "Zahlenraten zwischen " << MIN << " und " << MAX << endl; cout << "Gesuchte Zahl = " << gesucht << endl; int versuch = 0; while(versuch < MAX_VERSUCHE) { versuch++; int test = MIN+rand()%(MAX-MIN+1); cout << "Versuch " << versuch << " : " << test << endl; if (test == gesucht) { cout << "Gefunden!" << endl ; break; } } return 0; }