//递归算法 //0,1,1,2,3,5,8,13.... static int Recursion(int i) { if (i<=0) { return 0; } else if (i>0 && i<=2) { return 1; } else { return Recursion(i - 1) + Recursion(i-2); } }
Powered by: 博客园 Copyright © 2024 greyhh Powered by .NET 9.0 on Kubernetes