#include<stdio.h> #include<string.h> #include<math.h> int main(){ int a,b[40]; scanf("%d",&a); b[0]=2; b[1]=3; for(int j=2;j<=40;j++) b[j]=b[j-1]+b[j-2]; for(int i=0;i<a;i++){ int w; scanf("%d",&w); printf("Scenario #%d:\n",i+1); printf("%d\n\n",b[w-1]); } } |
Double click to view unformatted code.