public class BullSandCows {
public static void main(String[] args) {
cai();
}
static void cai(){
int number = (int) (Math.random()*100)+1;
while(true){
Scanner sc = new Scanner(System.in);
int zhong = sc.nextInt();
if(zhong>number){
System.out.println("猜大了");
}else if(zhong<number){
System.out.println("猜小了");
}
if(zhong==number){
System.out.println("恭喜你中奖了");
return;
}
}
}
}
JAVA_猜数字
最新推荐文章于 2022-05-26 11:30:00 发布