Cod sursa(job #1646780)

Utilizator DaniellDa Vinci Daniell Data 10 martie 2016 17:43:03
Problema Al k-lea termen Fibonacci Scor 20
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 k,c,f1=0,f2=1,f3;
int main()
{fin>>k;
while(k--){f3=(f1+f2)%666013;f1=f2;f2=f3;}
fout<<f1;
    return 0;
}