标题: 简单小游戏 [打印本页] 作者: 点丶酱 时间: 2018-12-15 18:31 标题: 简单小游戏 import java.util.Random;import java.util.Scanner;public class RandomGame { public static void main(String[] args) {
Random r = new Random(); int randomNum = r.nextInt(100); int i = 5; while(true) {
System.out.print("请输入数字(0-99),你还有" + i + "次机会:"); int guess = new Scanner(System.in).nextInt();