*

*

*

*

*

public static int solve(int n){
if(n == 1 || n == 2){
return n;
}else if(n <= 0){
return 0;
}else{
return solve(n-1) + solve(n-2);
}
}

//用一个HashMap来保存已经计算过的状态
static Map<Integer,Integer> map = new HashMap();
public static int solve(int n){
if(n <= 0)return 0;
else if(n <= 2){
return n;
}else{//是否计算过
if(map.containsKey(n)){
return map.get(n);
}else{
int m = solve(n-1) + solve(n-2);
map.put(n, m);
return m;
}
}
}

public static int solve(int n){
if(n <= 0)
return 0;
if(n <= 2){
return n;
}

int f1 = 0;
int f2 = 1;
int sum = 0;
for(int i = 1; i<= n; i++){
sum = f1 + f2;
f1 = f2;
f2 = sum;
}
return sum;
}

*

*

*

*

*

*

*

*
<http://mp.weixin.qq.com/s?__biz=MjM5MjAwODM4MA==&mid=2650706585&idx=1&sn=9a6b1d77af1a889657eb380f7922d1b1&chksm=bea6e34a89d16a5cfefed6644b893a91f6cf04b57bee3606456cf1084f7786de4d305aea08b1&scene=21#wechat_redirect>

<http://mp.weixin.qq.com/s?__biz=MjM5MjAwODM4MA==&mid=2650706545&idx=1&sn=480664dc0ebb2c2f8e850975de6a64fd&chksm=bea6e3a289d16ab40455cb261ddf6df5fbfb59b077949b4cb945abe409b499f3b60ccd80835f&scene=21#wechat_redirect>

*

<https://blog.csdn.net/csdnnews/article/details/83034779>

*

<https://mp.weixin.qq.com/s?__biz=MzA5MjcxNjc2Ng==&mid=2650558719&idx=3&sn=68d2af8f31f8ca320890c27872c34986&scene=21#wechat_redirect>

*

<https://blog.csdn.net/dQCFKyQDXYm3F8rB0/article/details/83028749>

*

*
Web3.0来了！玩法变了 <https://blog.csdn.net/Blockchain_lemon/article/details/83038023>

*

<https://blog.csdn.net/csdnnews/article/details/83005768>

2018 AI开发者大会

AI工程师必备大会

2018 AI开发者大会是一场由中美人工智能技术高手联袂打造的AI技术与产业的年度盛会！我们只讲技术，拒绝空谈！