View Code of Problem 60

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

Double click to view unformatted code.


Back to problem 60