View Code of Problem 60

#include<stdio.h>
#define N 40
void main()
{
	long int b[N];
	int i;
	b[0]=0;
	b[1]=2;
	b[2]=3;
	for(i=3;i<N;i++)
	{
		b[i]=b[i-1]+b[i-2];
	}
    int n;
	scanf("%d",&n);
	int j=0;
	while(n)
	{
		int s;
		scanf("%d",&s);
		j++;
		printf("Scenario #%d:\n",j);
		printf("%ld",b[s]);
		n--;	
		if(n>0)
		{
			putchar('\n');
		    putchar('\n');
		}
	}
}

Double click to view unformatted code.


Back to problem 60