Cod sursa(job #1646770)
Utilizator | Data | 10 martie 2016 17:38:33 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include <fstream>
using namespace std;
ifstream fin("kfib.in");
ofstream fout("kfib.out");
int k,i,c=2,f1,f2,f3;
int main()
{fin>>k;
f1=0;
f2=1;
while(c<=k)
{c++;
int aux=f2;f2+=f1;f1=aux;
}
fout<<f2%666013;
return 0;
}