View Code of Problem 60

#include<string.h>
#include<math.h>
#include<stdio.h>
#include<ctype.h>
int main()
{
	int i,k=1,s,t;
	int a[50]={0,2,3};
	for(i=3;i<50;i++)
	{
		a[i]=a[i-1]+a[i-2];
	}
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&s);
		printf("Scenario #%d:\n",k++);
		printf("%d\n",a[s]);
		printf("\n");
	 } 
	return 0;
 } 

Double click to view unformatted code.


Back to problem 60