题目链接:http://noi.openjudge.cn/ch0202/3089/
题解:因为每次都有两种走法,所以每次走都需要分别考虑两种走法的可能性数
#include <stdio.h>
#include <iostream>
using namespace std;
int pa(int p){
if(p==1)return 1;
if(p==2)return 2;
return pa(p-1)+pa(p-2);
}
int main(){
int n;
while(cin>>n){
int c=pa(n);
cout<<c<<endl;
}
}