public class Basic{
public static void main(String[] args){
Random rd = new Random();
int r = rd.nextInt(100);
Scanner scan = new Scanner(System.in);
int times = 3;
while(times > 0){
System.out.print("输入你的猜测");
int ss = scan.nextInt();
times - -;
if(ss >= 0 && ss <= 100){
if(ss > r){
System.out.println("猜大了,剩余次数("+ times +")");
}else if(){
System.out.pringtln("猜小了,剩余次数("+ times +")");
}else{
System.out.println("猜对了");
}
}else{
System.out.println("随机数为0-100之间,剩余次数("+ times +")");
}
scan.close();
}
}
}