class Game {
public static void playGame() {
int Num = (int)(Math.random()*100) + 1;
/*
* 0-50(50)大 25-50(25)小 25-35(35)大
*/
int star = 0;
int end = 100;
while(true){
Scanner sc = new Scanner(System.in);
System.out.println("请输入一个数字:"+star+"-"+end);
int guessNum = sc.nextInt();
if(Num > guessNum) {
System.out.println("您猜的数字"+guessNum+"小了");
star = guessNum;
}else if (Num < guessNum) {
System.out.println("您猜的数字"+guessNum+"大了");
end = guessNum;
}else {
System.out.println("恭喜你猜中了!!");
break;
}
}
}
}