Jav实现F(n)=F(n-1)+F(n-2)+.....+F(1)+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;
 }

原文地址:https://www.cnblogs.com/blythe/p/7373107.html