1.递归的方法:

private static int Max(int i) {
        if (i<=2) {
            return i;
        }
            return Max(i-1)+Max(i-2);
    }

 

相关文章:

  • 2021-11-12
  • 2021-10-24
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-21
  • 2021-06-04
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2021-08-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-18
  • 2022-01-31
相关资源
相似解决方案