mirror of
https://github.com/CyC2018/CS-Notes.git
synced 2025-07-07 17:54:31 +08:00
auto commit
This commit is contained in:
@ -154,7 +154,7 @@ public int JumpFloor(int n) {
|
|||||||
if (n <= 2)
|
if (n <= 2)
|
||||||
return n;
|
return n;
|
||||||
int pre2 = 1, pre1 = 2;
|
int pre2 = 1, pre1 = 2;
|
||||||
int result = 1;
|
int result = 0;
|
||||||
for (int i = 2; i < n; i++) {
|
for (int i = 2; i < n; i++) {
|
||||||
result = pre2 + pre1;
|
result = pre2 + pre1;
|
||||||
pre2 = pre1;
|
pre2 = pre1;
|
||||||
|
@ -154,7 +154,7 @@ public int JumpFloor(int n) {
|
|||||||
if (n <= 2)
|
if (n <= 2)
|
||||||
return n;
|
return n;
|
||||||
int pre2 = 1, pre1 = 2;
|
int pre2 = 1, pre1 = 2;
|
||||||
int result = 1;
|
int result = 0;
|
||||||
for (int i = 2; i < n; i++) {
|
for (int i = 2; i < n; i++) {
|
||||||
result = pre2 + pre1;
|
result = pre2 + pre1;
|
||||||
pre2 = pre1;
|
pre2 = pre1;
|
||||||
|
Reference in New Issue
Block a user