Cod sursa(job #1715158)
Utilizator | Data | 9 iunie 2016 23:40:54 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.24 kb |
#include <iostream>
#include <fstream>
using namespace std;
ifstream f("kfib.in");
ofstream g("kfib.out");
int main()
{int x=0,y=1,z,k;
f>>k;
while(k--%1332028)
{
z=(x+y)%666013;
x=y;
y=z;
}
g<<x;
return 0;
}