日期:2014-05-20 浏览次数:20762 次
Scanner scanner = new Scanner(System.in); while(1==1){ int number = scanner.nextInt(); String result = number>0&&number<6 ? "不好" : "好"; System.out.println(result+"\n"+"重新输入请按goon"); if((result = scanner.next()).equalsIgnoreCase("goon")){ System.out.println("请输入:"); continue; } break; }