Cod sursa(job #1646782)

Utilizator DaniellDa Vinci Daniell Data 10 martie 2016 17:44:24
Problema Al k-lea termen Fibonacci Scor 100
Compilator cpp Status done
Runda Arhiva educationala Marime 0.22 kb
#include <fstream>

using namespace std;
ifstream fin("kfib.in");
ofstream fout("kfib.out");
int k,c,f1=0,f2=1,f3;
int main()
{fin>>k;
while(k--%1332028){f3=(f1+f2)%666013;f1=f2;f2=f3;}
fout<<f1;
    return 0;
}