练习题一(for循环)

题目

给定数列1, 1, 1, 3, 5, 9, 17, …,从第4 项开始,每项都是前3 项的和。求
第20190324 项的最后4 位数字。

a,b,c=1,1,1
for i in range(4,20190325):
    y=(a+b+c)%10000
    a=b
    b=c
    c=y
print(y)

https://blog.csdn.net/weixin_43914593/article/details/112979520
http://oj.ecustacm.cn/problem.php?id=1453

posted @ 2021-03-23 01:55  arya-ns  阅读(77)  评论(0)    收藏  举报