Cod sursa(job #2078643)

Utilizator IVVladIon Vlad Vasile IVVlad Data 29 noiembrie 2017 19:40:48
Problema Nunta Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.28 kb
#include <fstream>
using namespace std;
ifstream f("nunta.in");
ofstream g("nunta.out");
short n;
int main()
{
    short x=1;
    short y=2,z=3;
    f>>n;
    while((n-3)!=0)
    {
        x=y;
        y=z;
        z=x+y;
        n--;
    }
    g<<z;
    return 0;
}