wordpress怎么修改html,成都seo公司排名,淘宝客网站容易做吗,河南省两学一做网站杨辉 Blaise Pascal 这是某些程序员看完会哭的代码。
杨辉三角形#xff08;Yanghui Triangle#xff09;#xff0c;是一种序列数值的三角形几何排列#xff0c;最早出现于南宋数学家杨辉1261年所著的《详解九章算法》一书。
欧洲学者#xff0c;最先由帕斯卡#x…
杨辉 Blaise Pascal 这是某些程序员看完会哭的代码。
杨辉三角形Yanghui Triangle是一种序列数值的三角形几何排列最早出现于南宋·数学家·杨辉1261年所著的《详解九章算法》一书。
欧洲学者最先由帕斯卡1623----1662在1654年发现这一规律故杨辉三角又称“帕斯卡三角形(Pascal Truangle)”。 图中暖色为偶数冷色为奇数。 代码1
private void button1_Click(object sender, EventArgs e) { webBrowser1.DocumentText Magic_Numbers.YangHui_Triangle(20); }
private void button1_Click(object sender, EventArgs e)
{webBrowser1.DocumentText Magic_Numbers.YangHui_Triangle(20);
}
代码2 using System; using System.Text;
namespace Legalsoft.Truffer.Algorithm { public static partial class Magic_Numbers { public static string YangHui_Triangle(int n) { StringBuilder sb new StringBuilder(); sb.AppendLine(style); sb.AppendLine(.n0 { float:left;width:90px;height:25px;line-height:25px;font-size:14px;text-align:center;border:dotted 1px #993333;background-color:#FFF9F9;margin-right:10px;margin-bottom:10px; } ); sb.AppendLine(.n1 { float:left;width:90px;height:25px;line-height:25px;font-size:14px;text-align:center;border:dotted 1px #333399;background-color:#F9F9FF;margin-right:10px;margin-bottom:10px; } ); sb.AppendLine(/style); sb.AppendLine(center); long[] last new long[n]; last[0] 1; for (int i 1; i n; i) { sb.AppendLine(tabletrtd); long[] array new long[i]; array[0] 1; sb.AppendLine(div classn (array[0]%2) array[0] /div); for (int j 1; j i; j) { array[j] last[j - 1] last[j]; sb.AppendLine(div classn (array[j] % 2) array[j] /div); } for (int j 0; j i; j) { last[j] array[j]; } sb.AppendLine(/td/tr/table); } return sb.ToString(); } } }
using System;
using System.Text;namespace Legalsoft.Truffer.Algorithm
{public static partial class Magic_Numbers{public static string YangHui_Triangle(int n){StringBuilder sb new StringBuilder();sb.AppendLine(style);sb.AppendLine(.n0 { float:left;width:90px;height:25px;line-height:25px;font-size:14px;text-align:center;border:dotted 1px #993333;background-color:#FFF9F9;margin-right:10px;margin-bottom:10px; } );sb.AppendLine(.n1 { float:left;width:90px;height:25px;line-height:25px;font-size:14px;text-align:center;border:dotted 1px #333399;background-color:#F9F9FF;margin-right:10px;margin-bottom:10px; } );sb.AppendLine(/style);sb.AppendLine(center);long[] last new long[n];last[0] 1;for (int i 1; i n; i){sb.AppendLine(tabletrtd);long[] array new long[i];array[0] 1;sb.AppendLine(div classn (array[0]%2) array[0] /div);for (int j 1; j i; j){array[j] last[j - 1] last[j];sb.AppendLine(div classn (array[j] % 2) array[j] /div);}for (int j 0; j i; j){last[j] array[j];}sb.AppendLine(/td/tr/table);}return sb.ToString();}}
}