package yanghuisanjiao;
public class yanghuisanjiao {
public static void main(String args[]){
int i,j;
int a[][];
a=new int[50][50];
for(i=0;i<a.length;i++){
a[i]=new int[i+1];
for(j=0;j<=i;j++){
if(i==0||j==0){
a[i][j]=1;
}
else{
a[i][j]=a[i-1][j-1]+a[i-1][j];
}
}
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
时间: 2024-10-12 16:35:44