求斐波那契数列的第1000项,要用递归法,求解答~谢谢
java吧
全部回复
仅看楼主
level 1
rt
2013年04月12日 00点04分 1
level 9
public int fib(int i){
if(i==1||i==2){
rerturn 1;
}
return fib(i-1)+fib(i-2);
}
貌似是这样吧。。直接伸手还是不好吧。
2013年04月12日 00点04分 2
好吧= =。我错了
2013年04月12日 00点04分
回复 永远de天空之城 :fibonacci 数列 java 第一二节课 练手的吧。
2013年04月12日 00点04分
1