标签:
1 public class Solution 2 { 3 public static void main(String[] args) 4 { 5 System.out.println("Graph 1"); 6 for(int i = 1; i <= 6; i++) 7 { 8 for(int j = 1; j <= i; j++) 9 System.out.print(j + " "); 10 System.out.println(); 11 } 12 13 System.out.println(); 14 15 System.out.println("Graph 2"); 16 for(int i = 1; i <= 6; i++) 17 { 18 for(int j = 1; j <= 6 - i + 1; j++) 19 System.out.print(j + " "); 20 System.out.println(); 21 } 22 23 System.out.println(); 24 25 System.out.println("Graph 3"); 26 for(int i = 1; i <= 6; i++) 27 { 28 for(int j = 1; j <= 6 - i; j++) 29 System.out.print(" "); 30 for(int j = i; j >= 1; j--) 31 System.out.print(j + " "); 32 System.out.println(); 33 } 34 35 System.out.println(); 36 37 System.out.println("Graph 4"); 38 for(int i = 1; i <= 6; i++) 39 { 40 for(int j = 1; j <= i - 1; j++) 41 System.out.print(" "); 42 for(int j = 1; j <= 6 - i + 1; j++) 43 System.out.print(j + " "); 44 System.out.println(); 45 } 46 } 47 }
标签:
原文地址:http://www.cnblogs.com/wood-python/p/5770511.html