Cod sursa(job #912047)
Utilizator | Data | 12 martie 2013 01:18:59 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 55 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include<cstdio>
FILE *f=fopen("kfib.in","r"),*g=fopen("kfib.out","w");
int main()
{
long long x=0,y=1,z,k;
fscanf(f,"%lld",&k);
while(k%1332028)
{
z=(x+y)%666013;
x=y;
y=z;
k--;
}
fprintf(g,"%lld",x);
}