View Code of Problem 108

#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<math.h>
int main(){
	long long a[60];
	int n;
	scanf("%d",&n);
	char t[60];
	a[0]=0;
	a[1]=1;
	a[2]=2;
	for(int i=3;i<=50;i++){
		a[i]=a[i-1]+a[i-2];
	}
	while(n--){
		scanf("%s",&t);
		int len=strlen(t);
		printf("%lld\n",a[len]);
	}
}



	

Double click to view unformatted code.


Back to problem 108