import java.util.Scanner;
import java.util.Random;
class Main1{
public static void main (String args[]){
Scanner sc = new Scanner (System.in);
Random rand = new Random();
int anwser, numbertoguess=rand.nextInt(1000);
System.out.print("What number am I thinking of? ");
anwser=sc.nextInt();
while (anwser != numbertoguess){
if (anwser > numbertoguess){
System.out.print("Lower. ");
anwser=sc.nextInt();
}else if (anwser < numbertoguess){
System.out.print("Higher. ");
anwser=sc.nextInt();
}else System.out.println("You are correct!! :)");
break;
}
}
}