备忘+搜索
#include <iostream>
int huo[10000]={0};
using namespace std;
/* run this program using the console pauser or add your own getch, system("pause") or input loop */
int search(int a){
if(huo[a]!=0) return huo[a];
else return huo[a]=search(a-2)+search(a-1);
}
int main(int argc, char** argv) {
int a;
cin>>a;
huo[1]=1;
huo[2]=2;
cout<<search(a);
return 0;
}