package exercise;
import java.util.Random;
import java.util.Scanner;
public class my_guss_number {
public static void main(String[] args) {
Random ra = new Random();
int n = ra.nextInt(10); //自动生成随机数
Boolean flag = true;
while (flag) {
System.out.println("please input number a:");
Scanner sc = new Scanner(System.in);
int a = sc.nextInt();
if (a > n) {
System.out.println("it is so big!");
}else if (a System.out.println("it is so small!");
}else {
System.out.println("good luck!");
flag = false; //防止产生死循环
}
}
}
}