public class Fibo {
int i;
Fibo(int i){
this.i=i;
}
int work(int n){
if(n==2||n==1)
return 1;
else
return (work(n-1)+work(n-2));
}
void print(){
System.out.print(work(i));
}
}
计算fibonacci数列
最新推荐文章于 2022-09-19 22:48:23 发布