Cod sursa(job #1920622)

Utilizator CostinteoGrigore Costin Teodor Costinteo Data 10 martie 2017 08:45:32
Problema Al k-lea termen Fibonacci Scor 0
Compilator cpp Status done
Runda Arhiva educationala Marime 0.28 kb
#include <fstream>

using namespace std;

int main()
{
    ifstream f("kfib.in");
    ofstream g("kfib.out");
    int a, b, c, i, k;
    a=1; b=1;
    f>>k;
    for (i=3; i<=k; i++)
    {
        c = a + b;
        b = a;
        a = c;
    }
    g<< c%666013;
}