logo
  • 教程列表
  • SO官方文档
  • 加泰罗尼亚数字算法
    • 加泰罗尼亚数算法基本信息
    • C 实现
  1. StackOverflow 文档
  2. algorithm 教程
  3. 加泰罗尼亚数字算法
  4. C 实现

C 实现

Created: November-22, 2018

public class CatalanNumber
{
    public static int Main(int number)
    {
        int result = 0;
        if (number <= 1) return 1;
        for (int i = 0; i < number; i++)
        {
            result += Main(i)*Main(number - i - 1);
        }
        return result;
    }
}
  • 加泰罗尼亚数算法基本信息

Copyright © 2018. All right reserved

tastones.com 备案号:鲁ICP备18045372号-1

  • 关于我们
  • 免责声明