Cod sursa(job #1275229)
Utilizator | Data | 24 noiembrie 2014 21:30:14 | |
---|---|---|---|
Problema | Nunta | Scor | 0 |
Compilator | cpp | Status | done |
Runda | Arhiva de probleme | Marime | 0.35 kb |
#include <iostream>
#include <cstdio>
#define LL long long int
using namespace std;
LL N;
int main(){
freopen("nunta.in","r",stdin);
freopen("nunta.out","w",stdout);
scanf("%lld",&N);
LL f=1,l=2,i,aux;
for (i=3; i<=N; i++){
aux=l;
l=l+f;
f=aux;
}
printf("%lld\n",l);
return 0;
}