标签:blog http io ar sp for on 2014 log
using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApplication3 { class Program { static void Main(string[] args) { int[,] number = new int[11, 11]; for (int i = 0; i < number.GetLength(0); i++) { for (int j = 0; j < number.GetLength(1); j++) { if (i == j || j == 0) number[i, j] = 1; else if (i != 0) number[i, j] = number[i - 1, j - 1] + number[i - 1, j]; else number[i, j] = 0; } } for (int i = 0; i < number.GetLength(0); i++) { for (int j = 0; j < number.GetLength(1); j++) { Console.Write("{0} ", number[i, j]); } Console.WriteLine(); } Console.ReadKey(); } } }
标签:blog http io ar sp for on 2014 log
原文地址:http://blog.csdn.net/hbd0616/article/details/41410117