在条件中测试输入
/** 来自 NowJava.com - 时代Java**/ import java.util.Scanner; public class Main { static Scanner sc = new Scanner(System.in); public static void main(String[] args) { int number = 2; String input = "Y"; while (input.equalsIgnoreCase("Y")) {//from 时 代 J a v a 公 众 号 - N o w J a v a . c o m System.out.println(number + " "); System.out.print("Do you want keep counting?" +