Cod sursa(job #1189375)
Utilizator | Data | 22 mai 2014 17:02:32 | |
---|---|---|---|
Problema | Al k-lea termen Fibonacci | Scor | 100 |
Compilator | cpp | Status | done |
Runda | Arhiva educationala | Marime | 0.26 kb |
#include<fstream>
using namespace std;
ifstream fin("kfib.in");
ofstream fout("kfib.out");
int main()
{
int x=0,y=1,z,k;
fin>>k;
while(k--%1332028)
{
z=(x+y)%666013;
x=y;
y=z;
}
fout<<x<<endl;
}