Cod sursa(job #394303)
Utilizator | Data | 10 februarie 2010 19:12:41 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include <fstream>
#define MOD 666013
using namespace std;
ifstream fin("kfib.in");
ofstream fout("kfib.out");
int n;
int main()
{
fin >> n;
for ( int i = 2; i<=n;i++)
f[i] = f[i-2]+f[i-1];
fout << f[n] % MOD;
fin.close();
fout.close();
return 0;
}