Cod sursa(job #458838)
Utilizator | Data | 26 mai 2010 16:12:07 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 20 |
Compilator | cpp | Status | done |
Runda | spad | Marime | 0.25 kb |
#include<fstream>
using namespace std;
int main()
{
int aux,k,ter=1,ant=1,i;
ifstream fin("kfib.in");
ofstream fout("kfib.out");
fin>>k;
for(i=3;i<=k;i++)
{
aux=ter%666013;
ter+=ant;
ter%=666013;
ant=aux;
}
fout<<ter;
}