import java.util.Scanner;
class Test1_CaiZi {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("请输入第一个整数,范围在1-100之间");
int CaiZi = (int)(Math.random()*100)+1;
while (true) {
int result = sc.nextInt();
if (result> CaiZi) {
System.out.println("在猜");
}else if (result<CaiZi) {
System.out.println("使劲猜");
}else {
System.out.println("哗哗哗中了");
break;
}
}
}
}
|
|