While迴圈實作

public class WhileDemo {

	public static void main(String[] args) {
		System.out.println("輸入可執行次數");
		int input = new java.util.Scanner(System.in).nextInt();

		int count = 0;
		while (count < input) {
			System.out.println("hello world!");
			count++;
		}
	}
}

發佈留言