- 跳台阶
…
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
include[HTML_REMOVED]
using namespace std;
const int N=20;
int n;
int f[N];
int main(){
scanf(“%d”,&n);
f[0]=1;
f[1]=1;
for(int i=2;i<=n;i++){
f[i]=f[i-1]+f[i-2];
}
printf(“%d”,f[n]);
return 0;
}
…