Run ID | Author | Problem | Lang | Verdict | Time | Memory | Code Length | Submit Time |
---|---|---|---|---|---|---|---|---|
13801 | hu | 爬楼梯 | C++ | Wrong Answer | 0 MS | 244 KB | 248 | 2023-04-03 15:48:39 |
#include<bits/stdc++.h> using namespace std; int f(int x) { if(x == 1) return 1; else if(x == 2) return 2; else return f(x - 2) + f(x - 1); } int main() { int ji; while(cin >> ji) { cout << f(ji) << endl; } return 0; }