码迷,mamicode.com
首页 > 其他好文 > 详细

HW4.18

时间:2016-08-14 17:42:54      阅读:136      评论:0      收藏:0      [点我收藏+]

标签:

技术分享

 

 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 }

 

HW4.18

标签:

原文地址:http://www.cnblogs.com/wood-python/p/5770511.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!