import java.util.Scanner;
import java.util.Random;
class Game1 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
Random a = new Random();
int num = (int)(a.nextDouble() * 100);
System.out.println("请输入数据0~100");
while (true) {
int b = sc.nextInt();
if (b > num) {
System.out.println("大了");
}else if (b < num) {
System.out.println("小了");
}else{
System.out.println("对了");
break;
}
}
}
}
|
|