public class Exercise {
public static void main(String[] args) {
int[][] a = new int[10][10];
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++) {
if ((j == 1) ------解决方案-------------------- (i == j)) {
a[i][j] = 1;
} else {
if ((i == 0)&&(j!=0) ){
a[i][j] = 0;
} else if ((j == 0)&&(i!=0)) {
a[i][j] = 0;
}else {
a[i][j] = a[i-1][j-1] + a[i-1][j];
}
}
}
}
for (int i = 0; i < 10; i++) {
for (int j = 0; j < 10; j++){
System.out.print(" "+a[i][j]);
}
System.out.println();
}