#include <iostream>
#include <cstdlib>
#include <ctime>
#define MIN 1
#define MAX 10
using namespace std;

int main() 
{
	srand(time(NULL));
	int gesucht = MIN+rand()%(MAX-MIN+1);
	cout << "Zahlenraten zwischen " << MIN << " und " << MAX << endl;
	int test;
	bool gefunden=false;
	while(!gefunden) {
		cout << "Geratene Zahl = ";
		cin >> test;
		if (test < MIN || test > MAX) {
			cout << "Zahl ist au�erhalb des Bereichs!" << endl;
			continue;
		}
		if (test == gesucht) break;
		cout << "Leider falsch geraten." << endl;
	}
	cout << "Gefunden!" << endl;
	return 0;
}