View Code of Problem 23

#include<stdio.h>
int main()
{int d,i;
long a[100];
a[1]=1;a[2]=2;
for(i=3;i<100;i++)
a[i]=a[i-1]+a[i-2];
while(scanf("%d",&d)&&d)
{printf("%lld\n",a[d]);
}
} 

Double click to view unformatted code.


Back to problem 23