#include <iostream>

using namespace std;
template <class T>
void getInput(T *val);
int main()
{
    srand(time(NULL));
    int random_number = rand() & 100;
    while (true)
    {
        int input_number;
        getInput(&input_number);
        input_number -= random_number;
        if (input_number < 0)
            cout << "Zu klein\n";
        else if (input_number > 0)
            cout << "Zu groß\n";
        else if (input_number == 0)
            break;
    }
    cout << "Du hast es erraten!\n";
    return 0;
}
template <class T>
void getInput(T *val)
{
    do
    {
        cout << "Please guess number(0-99): ";
        if (cin.fail())
        {
            cin.clear();
            cin.ignore();
        }
        cin >> *val;
    } while (cin.fail() || *val < 0 || *val >= 100);
}