题解 | #跳台阶#
跳台阶
https://www.nowcoder.com/practice/bfb2a2b3cdbd4bd6bba0d4dca69aa3f0
#include <iostream>
using namespace std;
int tot=0;
void steps(int u){
if(u<=1){tot++;return;}
steps(u-1);
steps(u-2);
}
int main() {
int a;
cin>>a;
steps(a);
cout<<tot;
return 0;
}
// 64 位输出请用 printf("%lld")
查看15道真题和解析