Cod sursa(job #1142564)
Utilizator | Data | 13 martie 2014 22:33:17 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.3 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("kfib.in");
ofstream g("kfib.out");
long long Fibb(long long x)
{
if(x==0) return 0;
if(x==1) return 1;
else return Fibb(x-1)+Fibb(x-2);
}
int main()
{ long long X;
f>>X;
g<<Fibb(X);
return 0;
}