using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace 杨辉三角
{
class Program
{
static void Main(string[] args)
{
int[,] a = new int[11, 11]
for (int i = 0; i <a.GetLength(0); i++)
{
a[i, 0] = 1;
a[i, i] = 1;
if (i > 1)
{
for (int j = 1; j < i; j++)
{
a[i, j] = a[i - 1, j - 1] + a[i - 1, j];
}
}
}
for (int i = 0; i < a.GetLength(0); i++)
{
for (int j = 0; j <= i; j++)
{
Console.Write("{0,5}",a[i, j]);
}
Console.WriteLine();
}
Console.ReadKey();
}
}
}