//问题说明
Fibonacci数列的递推公式为Fn=Fn-1 Fn-2,其中F1=F2=1。
n大时,Fn也非常大。 我现在想知道Fn除以10007的馀数是多少。
样品输入
10
样品输出
55
*/
#includestdio.h
长龙f [ 1000000 ],n,I;
int main ()。
int s;
f[1]=1;
f[2]=1;
scanf('%lld ',n );
for(I=3; i=n; I )
{
f[I]=(f[I-1]f[I-2] ) 007; //防止存储器溢出
}
printf('%lld ',f[n] );
返回0;
}