using System;
namespace ConsoleApplication1
{
class Class1
{
[STAThread]
static void Main(string[] args)
{
int[,] arr= new int[9,9];
for(int i=1;i<9; i++)
{
int j=i;
for(int k =1 ;k<=j;k++)
{
if (k==1)
{
arr[j,k]=1;
}
else if(k==j)
{
arr[j,k]=1;
}
else
{
arr[j,k] = arr[j-1,k-1] + arr[j-1,k];
}
Console.Write(arr[j,k]+" ");
}
Console.WriteLine();
Console.ReadLine();
}
}
}
}
![](https://img2024.cnblogs.com/blog/35695/202403/35695-20240328092537879-1189167464.jpg)