Cowboy Galaxy

Learner

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::
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();


}
}
}
}
posted on 2011-02-23 20:46  WarLock!  阅读(356)  评论(0编辑  收藏  举报