View Code of Problem 108

#include<stdio.h>
#include<string.h>
#include<math.h>
 

int main(){

	int a[50]={1,2};
	for(int i=2;i<50;i++){
		a[i]=a[i-1]+a[i-2];
	}

	int b;
	scanf("%d",&b);
	
	char  k[1000];
	getchar();
	for(int j=0;j<b;j++)
	{
		
		gets(k);
		
		printf("%d\n",a[strlen(k)-1]);

	}



	
}

Double click to view unformatted code.


Back to problem 108