• 杨辉三角


     public class yanghuisanjiao{

      public static void main(String[] args)
        {
            int i, j, n = 8, l, r;
            int a[] = new int[9];
            System.out.println(1);
            for (i = 1; i <= n; i++)
            {
                l = 1;
                System.out.print(1 + " ");
                for (j = 1; j <= i; j++)

                {
                    r = a[j];
                    a[j] = l + r; /* 每个数是上面两数之和 */
                    l = r;
                    System.out.print(a[j] + " ");
                }

                System.out.println();
            }
        }

    }

  • 相关阅读:
    HTML5 <input> multiple 属性
    AWS
    new Set() 数组去重
    IAM
    Amazon S3
    Promis 实例
    JS
    React 5
    React 4
    React 3
  • 原文地址:https://www.cnblogs.com/langz/p/6704767.html
Copyright © 2020-2023  润新知