Cod sursa(job #387193)
Utilizator | Data | 26 ianuarie 2010 23:25:16 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include<fstream>
using namespace std;
int main()
{
ifstream in("kfib.in");
ofstream out("kfib.out");
long long x[100000],k,i;
in>>k;
x[0]=0,x[1]=1;
for(i=2;i<=k;i++)
x[i]=x[i-1]+x[i-2];
out<<x[k]%666013;
return 0;
}