Jav实现F(n)=F(n-1)+F(n-2)+.....+F+1

Posted blythe

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Jav实现F(n)=F(n-1)+F(n-2)+.....+F+1相关的知识,希望对你有一定的参考价值。

private static int func(int count) {
  // TODO Auto-generated method stub
  int cou = 0;
  if(count==1){
   cou=1;
  }
  else if(count==2){
   cou=2;
  }
  else{
   for(int i=1;i<count;i++){
    cou+=func(count-i);
   }
   cou=cou+1;
  }
  return cou;
 }

以上是关于Jav实现F(n)=F(n-1)+F(n-2)+.....+F+1的主要内容,如果未能解决你的问题,请参考以下文章