#include <cstdio>
const int X = 10007;
int main() {
int n, Fibonacci[1000010];
scanf("%d",&n);
Fibonacci[1] = 1;
Fibonacci[2] = 1;
for(int i=3; i<=n; i++) {
Fibonacci[i] = (Fibonacci[i-2]%X + Fibonacci[i-1]%X)%X;
}
printf("%d",Fibonacci[n]);
return 0;
}
BEGIN-4 Fibonacci数列
最新推荐文章于 2020-04-09 20:26:45 发布