杨辉三角版本2
来源:互联网 发布:串口接收数据原理 编辑:程序博客网 时间:2024/05/29 10:04
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++) { if(number[i,j]==0) Console.Write(" "); else Console.Write("{0} ",number[i,j]); } Console.WriteLine(); } Console.ReadKey(); } }}
0 0
- 杨辉三角版本2
- 杨辉三角<2>
- 【原创】杨辉三角之函数调用版本
- 杨辉三角/帕斯卡三角
- 杨辉三角(2)
- 15-2杨辉三角
- 项目 2-杨辉三角
- 15-2杨辉三角
- 15--2杨辉三角
- hpuoj1298: 杨辉三角2
- (尹成)杨辉三角(正三角 倒三角)
- 学习:杨辉三角(帕斯卡三角)
- 15-2 杨辉三角。二维数组
- 第十五周-2杨辉三角
- 第十五周项目2-杨辉三角
- 第十五周 项目2--杨辉三角
- 十五周项目2-杨辉三角
- 十五周:项目2杨辉三角
- iOS7隐藏状态栏 status Bar
- ESRI 修改DrawTool的提示
- httpclient使用详解
- CentOS上的SciDB14.3单机安装配置
- Several ports (8080, 8009) required by Tomcat v6.0 Server at localhost are already in use. The serve
- 杨辉三角版本2
- 【BZOJ2229】【ZJOI2011】最小割 {没有错,这道题的算法跟题帽是一样的!!!}
- HashMap详解
- 逐行Porgressive隔行Interlaced扫描的超详细讲解
- Android应用程序框架层和系统运行库层日志系统源代码分析
- 【CODEFORCES】 C. Appleman and Toastman
- jquery flot pie画饼图
- 李晨向范冰冰求婚是真的吗
- BZOJ 3205 Apio2013 机器人 斯坦纳树