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