View Code of Problem 23

#include<stdio.h>
int main()
{
	int i,m;
	long int k,b,s;
	s=1;
	b=0;
	while(scanf("%d",&m)!=EOF&&m!=0)
	{
		for(i=0;i<m;i++)
		{
			k=b;
			b=b+s;
			s=k;
		}
		printf("%ld\n",s+b);
		s=1;
		b=0;
	}
	return 0;
}

Double click to view unformatted code.


Back to problem 23