GuessNumber

时间:2021-07-09 14:32:35
import java.util.*;

public class GuessNumber {
public static void main(String[] args) {
int num = new Random().nextInt(100), temp;
Scanner sc = new Scanner(System.in);
while (true) {
temp = sc.nextInt();
if (temp < num) {
System.out.println("太小了");
} else if (temp > num) {
System.out.println("太大了");
} else
System.out.println("猜对了");
}
}
}

GuessNumber

GuessNumber

相关文章