import java.util.Scanner;

 public class Solution
 {
     public static void main(String[] args)
     {
         Scanner input = new Scanner(System.in);
         System.out.print("Enter an integer: ");
         int number = input.nextInt();

         input.close();

         displayPattern(number);
     }

     public static void displayPattern(int n)
     {
         for(int i = 0; i < n; i++)
         {
             for(int j = 0; j < n - i; j++)
                 System.out.print("  ");
             for(int j = i + 1; j > 0; j--)
                 System.out.print(j + " ");
             System.out.println();
         }
     }
 }

HW5.6的更多相关文章

  1. HW5.36

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  2. HW5.35

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  3. HW5.34

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  4. HW5.33

    import java.util.Calendar; public class Solution { public static void main(String[] args) { long tot ...

  5. HW5.32

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  6. HW5.31

    import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner i ...

  7. HW5.30

    public class Solution { public static void main(String[] args) { for(int i = 3; i <= 1000; i++) i ...

  8. HW5.29

    public class Solution { public static void main(String[] args) { int n1 = (int)(Math.random() * 5 + ...

  9. HW5.28

    public class Solution { public static void main(String[] args) { System.out.printf("%s\t%s\n&qu ...

  10. HW5.27

    public class Solution { public static void main(String[] args) { int totalCount = 0; int lineCount = ...

随机推荐

  1. C# 格式化字符串(转载)

    1 前言 如果你熟悉Microsoft Foundation Classes(MFC)的CString,Windows Template Library(WTL)的CString或者Standard ...

  2. WPF 控件

    ****ScrollViewer**** 前台: <ScrollViewer  HorizontalScrollBarVisibility="Auto" VerticalSc ...

  3. ModelState用法

    ModelState.AddModelError:添加错误信息 ModelState是一个字典类型,这句话的作用是向ModelState中添加一条错误信息,第一个参数是Key,第二个参数是Value. ...

  4. C#基础|面向对象之多态

      什么是多态   一句话解释,同一种事物表现出的多种形态. 看完以后,应该还是蒙的,还是看代码吧.. 现有Person类,Student类,Teacher类 其中Person类是Student和Te ...

  5. 使用ssh公钥实现免密码登录

    使用ssh公钥实现免密码登录 ssh 无密码登录要使用公钥与私钥.linux下可以用用ssh-keygen生成公钥/私钥对,下面我以CentOS为例. 有机器A(10.207.160.34),B(10 ...

  6. 30 个最棒的 jQuery 的拖放插件

    jQuery 允许用户为任意 DOM 元素添加可拖放的功能,通过 jQuery 的拖放插件你可以轻松实现网页上任意元素的拖拽操作.在本文中我们向你推荐 30 个最棒的 jQuery 的拖放插件. 点击 ...

  7. nginx 配置的server_name参数(转)

    转自:http://www.sklinux.com/373 nginx中的server_name指令主要用于配置基于名称虚拟主机. 一 匹配顺序,server_name指令在接到请求后的匹配顺序如下: ...

  8. http://www.tuicool.com/articles/RzUzqei

    http://www.tuicool.com/articles/RzUzqei http://www.cnblogs.com/piaolingzxh/archive/2015/01/01/419783 ...

  9. Linux中断处理流程

    http://blog.csdn.net/dianhuiren/article/details/7468956

  10. Android:WebView深入使用

    webView = (WebView) findViewById(R.id.info_detail_webview); WebSettings webSettings = webView.getSet ...