/* Note:Your choice is C IDE */
#include "stdio.h"
#define MOD 10007
#define MAX 10000001
int i,n,f[MAX];
int main()
{
scanf("%d",&n);
f[1]=1;
f[2]=1;
for(i=3;i<=n;i++){
f[i]=(f[i-1]+f[i-2])%MOD;
}
printf("%d",f[n]);
return 0;
}
Fibonacci数列
最新推荐文章于 2021-03-05 22:19:11 发布