package 本章總結; import java.util.Scanner; public class A01 { public static void main(String[] args) { // TODO Auto-generated method stub Scanner in = new Scanner (System.in); System.out.println("請輸入打印行數:"); int rows =in.nextInt(); for (int i = 1; i <=rows; i++) { for (int j = 1; j <=i; j++) { System.out.print(j+" "); } System.out.println(); } } }