import java.util.Random; import java.util.Scanner; public class caishuzi { public static void main(String[] args){ Random random = new Random(); int math = random.nextInt(100); Scanner scanner = new Scanner(System.in); for (int i = 0; i < 10; i++) { int a = scanner.nextInt(); if(a == math){ System.out.println("恭喜答对啦!"); return; }else { if(a>math){ System.out.println("猜大了"); }else { System.out.println("猜小了"); } } } } }