View Code of Problem 60

#include <bits/stdc++.h>
using namespace std;
int main(){
	int a[41],i=1,t,n;
	a[0]=1;a[1]=2;
	for(int i=2;i<41;i++)
		a[i]=a[i-1]+a[i-2];
	cin>>t;
	while(t--){
		cin>>n;
		printf("Scenario #%d:\n",i++)
		cout<<a[n]<<endl<<endl;;
	}
} 
/*
Main.cc: In function 'int main()':
Main.cc:12:3: error: expected ';' before 'cout'
   cout<<a[n]<<endl<<endl;;
   ^
*/

Double click to view unformatted code.


Back to problem 60