------解决方案-------------------- public class YangHui { public static void main(String[] args) { int n = 10; int yh[][] = new int[n][2*n+2]; yh[0][n] = 1; for (int i = 0; i < n; i++){ for (int j = 0; j <2*n+1; j++){ if(i != 0&&j !=0 ){ yh[i][j] = yh[i-1][j-1] + yh[i-1][j+1]; } StringBuffer sb =new StringBuffer(); sb.append(" "); if (yh[i][j]==0){