题意:http://acm.hdu.edu.cn/showproblem.php?pid=2070
解答:
#include<stdio.h>
int main()
{
__int64 a[60]={1,0};
int n,i;
while(scanf("%d",&n),n!=-1)
{
a[0]=0,a[1]=1;
for(i=2;i<=50;i++)
a[i]=a[i-1]+a[i-2];
printf("%I64d\n",a[n]);
}
return 0;
}