题解 | #跳台阶#
跳台阶
https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
int jumpFloor(int n) { int a=1,b=2; int c; while(n>2) { c=a+b; a=b; b=c; n--; } return c; }
跳台阶
https://www.nowcoder.com/practice/8c82a5b80378478f9484d87d1c5f12a4
int jumpFloor(int n) { int a=1,b=2; int c; while(n>2) { c=a+b; a=b; b=c; n--; } return c; }
相关推荐