Cod sursa(job #2215875)
| Utilizator | Data | 24 iunie 2018 00:46:21 | |
|---|---|---|---|
| Problema | Al k-lea termen Fibonacci | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.29 kb |
#include <iostream>
using namespace std;
#include<fstream>
#define mod 666013
int main ()
{
int n,y=1,x=0,i=1;
ifstream f("kfib.in");
ofstream g("kfib.out");
f>>n;
while(i<n)
{
y=y+x;
x=y-x;
i++;
}
g<<y;
return 0;
}
