View Code of Problem 23

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

Double click to view unformatted code.


Back to problem 23