#include<cstdio> using namespace std; typedef unsigned long long llu; llu f[90]={0}; llu fib(int n) { if (n<4) f[n]=n; if (f[n]==0) f[n]=fib(n-2)+fib(n-1); return f[n]; } int main() { int n; while (scanf("%d",&n)&& n) printf("%llu\n",fib(n)); return 0; }
Wednesday, July 20, 2016
Published July 20, 2016 by Sourav Chowdhury with 0 comment
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment