#include<iostream>
#include<time.h>
using namespace std;
int main(){
int RAN=1;
while (1!=0){
srand(time(0));
int random_number = rand() % 101;
int a=-1,b=100,c=0,times=0;
cout<<"PLAY "<< RAN<<endl;
cout<<"Enter the number between 0 to 100:";
cin>>a;
while(a!=random_number){
if (a>random_number){
cout<<"Enter the number between "<<c<<" to "<<a-1<<":";
b=a;
} else{
cout<<"Enter the number between "<<a+1<<" to "<<b<<":";
c=a;
}
cin>>a;
times++;
}
cout<<"You have guessed the number "<<random_number<<" in "<<times<<" times."<<endl;
RAN++;
system("pause");
}
}