1578. [算法课动态规划]爬楼梯

include

using namespace std; int walk(int n) {

if(n==1) return 1; else if(n==2) return 2; else return walk(n-1)+walk(n-2);

}

int main() {

int n; int m=1; cin >>n; cout<<walk(n)<<endl; return 0;

}