Y
package 杨辉三角;
public class Y {
public static void main(String arg[]){
int a[][];
a=new int[5][5];
int i,j;
for(i=0;i<5;i++){
for(j=0;j<=i;j++){
if(i==j||j==0)
a[i][j]=1;
else
a[i][j]=a[i-1][j]+a[i-1][j-1];
System.out.print(a[i][j]+"");}
System.out.print('\n');
}
}
}