当前位置: 首页 > news >正文

做网站电话中央电视台新闻联播

做网站电话,中央电视台新闻联播,做网站的技术员,线上推广引流以贝尔数为基础,参考杨辉三角形,也可以生成贝尔三角形(Bell triangle),也称为艾特肯阵列(Aitkens Array),皮埃斯三角形(Peirce Triangle)。 贝尔三角形的构造…

贝尔数为基础,参考杨辉三角形,也可以生成贝尔三角形(Bell triangle),也称为艾特肯阵列(Aitken's Array),皮埃斯三角形(Peirce Triangle)。

贝尔三角形的构造方法:
(1)第一行第一个元素是1,即a[1][1] = 1
(2)对于n>1,第n行第一项等于第n-1行最后一项,即a[n][1] = a[n-1][n-1];
(3)对于m,n>1,第n行第m项等于它左边和左上方的两个数之和,即a[n][m] = a[n][m-1] + a[n-1][m-1];
 

1 文本格式

using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;

namespace Legalsoft.Truffer.Algorithm
{
    public static partial class Number_Sequence
    {
        /// <summary>
        /// 贝尔三角形(Bell triangle)
        /// 艾特肯阵列(Aitken's Array)
        /// 皮埃斯三角形(Peirce Triangle)
        /// </summary>
        /// <param name="n"></param>
        /// <returns></returns>
        public static string Bell_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 + 1];
            long[] array = new long[n + 1];
            last[0] = 1;
            for (int i = 1; i <= n; i++)
            {
                sb.AppendLine("<table><tr><td>");
                array[0] = (i > 1) ? last[i - 2] : last[i - 1];
                sb.AppendLine("<div class='n" + (array[0] % 2) + "'>" + array[0] + "</div>");
                for (int j = 1; j < i; j++)
                {
                    array[j] = array[j - 1] + last[j - 1];
                    sb.AppendLine("<div class='n" + (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();
        }
    }
}
 

——————————————————————

POWER BY TRUFFER.CN

2 代码格式

using System;
using System.Text;
using System.Collections;
using System.Collections.Generic;namespace Legalsoft.Truffer.Algorithm
{public static partial class Number_Sequence{/// <summary>/// 贝尔三角形(Bell triangle)/// 艾特肯阵列(Aitken's Array)/// 皮埃斯三角形(Peirce Triangle)/// </summary>/// <param name="n"></param>/// <returns></returns>public static string Bell_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 + 1];long[] array = new long[n + 1];last[0] = 1;for (int i = 1; i <= n; i++){sb.AppendLine("<table><tr><td>");array[0] = (i > 1) ? last[i - 2] : last[i - 1];sb.AppendLine("<div class='n" + (array[0] % 2) + "'>" + array[0] + "</div>");for (int j = 1; j < i; j++){array[j] = array[j - 1] + last[j - 1];sb.AppendLine("<div class='n" + (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();}}
}

 

http://www.zhongyajixie.com/news/41176.html

相关文章:

  • 做网站用什么web服务器怎么在百度上设置自己的门店
  • 网站建设报价兴田德润在哪里台州seo优化公司
  • 在手机上建设网站教程网站seo推广
  • dede中英文企业网站seo设置是什么
  • 宜昌市政府采购网上商城核心关键词如何优化
  • 网站如何在百度搜索到seo新方法
  • 门户网站建设中存在的问题seo怎么赚钱
  • 建设网站目的软文营销成功案例
  • 做调查的网站有哪些小红书笔记关键词排名优化
  • 自然村 网站建设培训机构专业
  • 事务所网站制作方案济南网站优化
  • 哪些网站做耽美站长之家网站
  • 4在线做网站电商平台推广怎么做
  • 专业做网站公司怎么样如何制作一个简易网站
  • 学校网站样式seo管理与优化期末试题
  • 图片设计制作软件seo建站优化
  • 青海营销型网站建设广州百度网站排名优化
  • 山东济铁工程建设集团有限公司网站百度提交网址多久才会收录
  • 郑州公司建站模板男生技能培训班有哪些
  • wordpress原生appseo发展前景怎么样啊
  • 90设计网是干嘛的网站自然优化
  • wordpress制作博客seo软件推广哪个好
  • wordpress excerptseo关键词优化指南
  • 网络加速器免费永久版关键词优化排名网站
  • 移动端网站开发与网页开发区别最大免费发布平台
  • 昆明网站服务器天津网站排名提升
  • 德化住房和城乡建设网站株洲seo优化公司
  • 教育网站的开发与建设论文品牌策略包括哪些内容
  • 北京亦庄做网站公司2023年最新时政热点
  • .net做中英文网站精准营销通俗来说是什么