Cod sursa(job #1905933)
Utilizator | Data | 6 martie 2017 11:42:08 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.27 kb |
#include <bits/stdc++.h>
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)
{
k--;
z=(x+y)%666013;
x=y;
y=z;
}
g<<x;
return 0;
}