P1720 月落乌啼算钱(斐波那契数列)--python3实现

https://www.luogu.com.cn/problem/P1720

"""

P1720 月落乌啼算钱(斐波那契数列)
https://www.luogu.com.cn/problem/P1720

"""

a=1
b=1
c=0

n=int(input())

for i in range(3,n+1):
            
            c=a+b
            a=b
            b=c
            

print(c,end='.00')


你可能感兴趣的:(洛谷,【入门3】循环结构,算法,信奥,CSP-J,python,洛谷)