题目1092:Fibonacci
#include<stdio.h>
int f[40];
int main(int argc, char *argv[])
{
f[0]=0;
f[1]=1;
for(int i=2;i<=30;++i)
f[i]=f[i-1]+f[i-2];
int n;
while(~scanf("%d",&n))
{
printf("%d\n",f[n]);
}
return 0;
}
/**************************************************************
Problem: 1092
User: kirchhoff
Language: C
Result: Accepted
Time:0 ms
Memory:912 kb
****************************************************************/