标签:
1 #include<stdio.h>//超级台阶(76) 2 #include<string.h> 3 int f(int x){ 4 int sum=0,i,a[45],t; 5 memset(a,0,sizeof(a)); 6 a[0]=1;a[1]=1; 7 for(i=0;i<x;i++){ 8 if(i>=2)a[i]=a[i-1]+a[i-2]; 9 sum=a[i]; 10 } 11 return sum; 12 } 13 int main() 14 { 15 int x,m; 16 scanf("%d",&x); 17 while(x--){ 18 scanf("%d",&m); 19 if(m!=1)printf("%d\n",f(m)); 20 else printf("0\n"); 21 } 22 return 0; 23 }
标签:
原文地址:http://www.cnblogs.com/minimalism/p/4537625.html