import java.util.Scanner;

public class Hello {
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int number =(int) (Math.random() * 100 + 1); // [0,1) --> [0,100) --> [1,101) --> int[1,100]
		int a;
		int count = 0;
		do{
			a = in.nextInt();
			count = count + 1;
			if(a > number)
			{
				System.out.println("偏大");
			}
			if(a < number)
			{
				System.out.println("偏小");
			}
		}while(a != number);
		System.out.println("恭喜你猜对了,共用了"+count+"次");
	}
}

 

posted on 2022-01-16 16:09  Rabbit_XIN  阅读(15)  评论(0)    收藏  举报