李敏  
日历
<2024年5月>
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
统计
  • 随笔 - 1
  • 文章 - 40
  • 评论 - 4
  • 引用 - 0

导航

常用链接

留言簿(1)

文章分类

文章档案

相册

收藏夹

它山之石

聚贤庄

搜索

  •  

最新评论

 
     1

     1     1

     1     2     1

     1     3     3     1

     1     4     6     4     1

     1     5    10    10     5     1 


   
int[] lastNums = 1 };
        
int[] nextNums;

        
int len = 5;

        
for (int i = 2; i <= len; i++{
            nextNums 
= new int[i];

            
for (int j = 1; j < i - 1; j++{
                nextNums[j] 
= lastNums[j - 1+ lastNums[j];
            }


            nextNums[
0= lastNums[0];
            nextNums[i 
- 1= lastNums[i - 2];

            lastNums 
= nextNums;
        }
posted on 2009-09-20 12:36 李敏 阅读(229) 评论(0)  编辑  收藏 所属分类: 算法

只有注册用户登录后才能发表评论。


网站导航:
 
 
Copyright © 李敏 Powered by: 博客园 模板提供:沪江博客