15分求助
查看原帖
15分求助
966040
HAPPY804楼主2024/5/31 21:01
n=int(input())
p=int(input())
a=1
b=1
c=0
if n==1 or n==2:
    c=1
else:   
    for x in range(n-2):
        c=a+b
        a=b
        b=c
if p!=0:
    print(c%p)
else:
    print(0)
2024/5/31 21:01
加载中...