Record
Record
public int Fibonacci(int n) {
if( n==0 ){
return 0;
}else if(n==1 || n==2 ){
return 1;
}else{
return calcu(n-3,1,1);
}
}
public static int calcu(int n,int one,int two){
if(n == 0){
return one+two;
}else{
n--;
int tmp = one+two;
one = two;
two = tmp;
return calcu(n,one,two);
}
}