def frog(n):
if n <= 2:
return n
t1, t2 = 1, 2
for i in range(3, n+1):
t1, t2 = t2, t1+t2
return t2
n = int(input())
print(frog(n))
2024-01-30 16:17:34
def frog(n):
if n <= 2:
return n
t1, t2 = 1, 2
for i in range(3, n+1):
t1, t2 = t2, t1+t2
return t2
n = int(input())
print(frog(n))
下一篇:7连-DAY 4 总结