Cod sursa(job #708600)

Utilizator hunter_ionutzzzFarcas Ionut hunter_ionutzzz Data 6 martie 2012 22:56:35
Problema Al k-lea termen Fibonacci Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.21 kb
#include<fstream>
using namespace std;
ifstream fin("kfib.in");
ofstream fout("kfib.out");
int x,y=1,z,k;
int main()
{   fin>>k;
    while(k--%1332028)
	{
		z=(x+y)%666013;
		x=y;y=z;
	}
    fout<< x <<'\n';
}