View Code of Problem 108

#include "stdio.h"
#include "math.h"
#include "string.h"


void main()
{
	char s[100];
	int i,n,k;
	long int b[100];
	b[0]=0;
	b[1]=1;
	for(i=2;i<100;i++)
		b[i]=b[i-1]+b[i-2];
	scanf("%d",&n);
	for(i=0;i<n;i++)
	{
		fflush(stdin);
		scanf("%s",&s);
		k=strlen(s)+1;
		printf("%ld\n",b[k]);
	}
}

Double click to view unformatted code.


Back to problem 108