-3
当我运行这个时,int x = 0
和1
被添加到x
到它每次运行。该程序继续打印出“第1轮”,不允许任何时间输入任何内容。这不是关于阅读输入,而是关于如何输入内容而不让程序变得疯狂。程序连续打印而不是等待输入
while (!broken) {
int pointcount = 0;
System.out.println("Round " + x);
Scanner jumpOption = new Scanner(System.in);
if (jumpOption.equals("W")) {
pointcount += 1;
Random rand = new Random();
if (rand.nextInt(100) == 0) {
broken = true;
感谢您的帮助! –