递归-裴波那契数列

using System;
using System.Collections.Generic;

public class MyClass
{
    
public static void Main()
    
{
        
int a=Fb(6);
        WL(a);
        RL();
    }

    
public  static int Fb(int n)
    
{
        
int result=0;
        
if(n==1 || n==2)
            result
=1;
        
else
            result
=Fb(n-2)+Fb(n-1);
        
return result;
    }

    
    
Helper methods
}

posted on 2008-02-02 18:18  Haozes  阅读(489)  评论(0编辑  收藏  举报