public class study{ public static void main(String args[]){ int i,j,level=7; int Yang[][] = new int[level][]; System.out.println("杨辉三角"); for(i = 0;i<Yang.length;i++){ Yang[i] = new int[i+1]; } Yang[0][0] = 1; //第一个元素为1 } for(i = 1;i<Yang.…
package com.llh.demo; /** * 杨辉三角 * * @author llh * */ public class Test { /* * 杨辉三角 */ public static void main(String[] args) { int[] a = new int[11]; int num = 1; // for (int i = 1; i <= 10; i++) { for (int j = 1; j <= i; j++) { int c = a[j]; a[j]…
import java.util.Scanner; public class SumTrangles { public static void func(int n) { if (n < 0) return; int[][] a = new int[n][n]; for (int i = 0;i < n;i++) { if (i == 0) { a[i][0] = 1; System.out.print(1); } for (int j = 0;j < i;j++) { if (j ==…