题目:​​http://acm.hdu.edu.cn/showproblem.php?pid=2041​

题目是一个递退题,用前两种状态,来表示现在的状态,,,

关系式:f(n)=f(n-1)+f(n-2);
#include <stdio.h>
int main()
{
int n,t;
int i,a[45];
a[0]=a[1]=1;
for(i=2;i<45;i++)
a[i]=a[i-1]+a[i-2];
scanf("%d",&t);
while(t--)
scanf("%d",&n),printf("%d\n",a[n-1]);
return 0;
}