代碼
package Test1;
public class Yhsj
{
public static void main(String[] args)
{
int a[][]=new int[10][10];
for(int i=0;i<a.length;i++)
{
for(int b = 0; b < a.length-i; b++)
System.out.print(" ");
{for(int j=0;j<=i;j++)
{
if(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.println();
}
}
}
}