package myjavase;

import java.util.Scanner;

//import javax.swing.JOptionPane;


public class q3 {


public static void main(String[] args){

int number = (int)(Math.random() * 101);

Scanner input = new Scanner(System.in);

while(true)

{

System.out.println("\n请输入您猜测的号码:");

int guest = input.nextInt();

if(guest == number){

System.out.println("是的,您猜对了!\n就是 " + guest);

break;

}else if(guest > number){

System.out.println("您猜的数大了!");

}else if(guest < number){

System.out.println("您猜的数小了!");

}

}

input.close();

       }

}