#include <iostream>
#include <string>
using namespace std;
int askUser(int high, int low = 1);
int askUser();
int main()
{
int value = 0;
int number = askUser(15);
cout << "You entered: " << number << "\n\n";
number = askUser();
cout << "You entered: " << number << "\n\n";
return 0;
}
int askUser(int high, int low)
{
int input;
do
{
cout << "Please enter a number" << " (" << low << " - " << high << "): ";
cin >> input;
}
while (input > high || input < low);
return input;
}
int askUser()
{
int value;
cin >> value;
return(value);
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8c3RyaW5nPgoKdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCmludCBhc2tVc2VyKGludCBoaWdoLCBpbnQgbG93ID0gMSk7CmludCBhc2tVc2VyKCk7CgppbnQgbWFpbigpCnsKICAgaW50IHZhbHVlID0gMDsKICAgaW50IG51bWJlciA9IGFza1VzZXIoMTUpOwogICBjb3V0IDw8ICJZb3UgZW50ZXJlZDogIiA8PCBudW1iZXIgPDwgIlxuXG4iOwoKICAgbnVtYmVyID0gYXNrVXNlcigpOwogICBjb3V0IDw8ICJZb3UgZW50ZXJlZDogIiA8PCBudW1iZXIgPDwgIlxuXG4iOwoKICAgcmV0dXJuIDA7Cn0KCmludCBhc2tVc2VyKGludCBoaWdoLCBpbnQgbG93KQp7CiAgIGludCBpbnB1dDsKICAgZG8KICAgewogICAgICBjb3V0IDw8ICJQbGVhc2UgZW50ZXIgYSBudW1iZXIiIDw8ICIgKCIgPDwgbG93IDw8ICIgLSAiIDw8IGhpZ2ggPDwgIik6ICI7CiAgICAgIGNpbiA+PiBpbnB1dDsKICAgfQogICB3aGlsZSAoaW5wdXQgPiBoaWdoIHx8IGlucHV0IDwgbG93KTsKCiAgIHJldHVybiBpbnB1dDsKfQoKaW50IGFza1VzZXIoKQp7CiAgIGludCB2YWx1ZTsKICAgY2luID4+IHZhbHVlOwogICByZXR1cm4odmFsdWUpOwp9