Cod sursa(job #1107109)

Utilizator TeofilosTeofil Teofilos Data 13 februarie 2014 17:20:52
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include<fstream>
using namespace std;
ifstream f("kfib.in");
ofstream g("kfib.out");
int n,x,y,m,i;
int main()
{
   f>>n;
    n=n%(666013*2+2);    x=1;    y=1;
    for(i=3;i<=n;i++)
    {
        m=(x+y)%666013;        x=y;        y=m;
    }
    g<<y<<" ";
    return 0;
}