/* 1
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
*/
//yang hui shan jiao
public class Image2
{
public static void main(String args[])
{
final int ROW=6;
int a[][]=new int[ROW+1][];
for(int i=0;i<=ROW;i++)
{
a[i]=new int[i+1];
}
Image2(a,ROW);
}
static void Image2(int a[][],int ROW)
{
for(int i=0;i<=ROW;i++)
for(int j=0;j<=a[i].length-1;j++)
{
if(i==0||j==0||j==a[i].length-1)
a[i][j]=1;
else a[i][j]=a[i-1][j-1]+a[i-1][j];
}
for(int i=0;i<=ROW;i++)
{
for(int x=9;x>i;x--)
System.out.print(" ");
for(int j=0;j<=a[i].length-1;j++)
System.out.print(a[i][j]+" ");
System.out.println(" ");
}
}
}
1 1
1 2 1
1 3 3 1
1 4 6 4 1
1 5 10 10 5 1
1 6 15 20 15 6 1
*/
//yang hui shan jiao
public class Image2
{
public static void main(String args[])
{
final int ROW=6;
int a[][]=new int[ROW+1][];
for(int i=0;i<=ROW;i++)
{
a[i]=new int[i+1];
}
Image2(a,ROW);
}
static void Image2(int a[][],int ROW)
{
for(int i=0;i<=ROW;i++)
for(int j=0;j<=a[i].length-1;j++)
{
if(i==0||j==0||j==a[i].length-1)
a[i][j]=1;
else a[i][j]=a[i-1][j-1]+a[i-1][j];
}
for(int i=0;i<=ROW;i++)
{
for(int x=9;x>i;x--)
System.out.print(" ");
for(int j=0;j<=a[i].length-1;j++)
System.out.print(a[i][j]+" ");
System.out.println(" ");
}
}
}