#include <iostream>
#include <cstdlib>
using namespace std;

int main (){
  //*************************************************************
  // first generate a uniform random number between 0 and 1
  // set the random seed with the time stamp
  //*************************************************************
  int iranda = unsigned(time(0)); // seconds since Jan 1st, 1970
  srand(iranda); // set the random seed
  int secret_number = rand()%101; // rand() returns random #'s from 0 to RAND_MAX

  cout << "I am thinking of a number between 0 to 100... try to guess it!\n";

  int n;
  cout << "Enter your starting guess\n";
  cin >> n;

  while (n!=secret_number) {
    if (n>secret_number){
      cout << "You guessed too high.  Guess again!\n";
    }else{
      cout << "You guessed too low.  Guess again!\n";
    }
    cin >> n;
  }
  cout << "You guessed it!\n";

  return 0;
}

