标签:blog http io for 2014 amp log ef
#include <stdio.h>
#define MAX 50+1
int fib(int n)
{
int i,a[MAX];
a[1]=a[2]=1;
for (i=3; i<=n; i++)
a[i]=a[i-1]+a[i-2];
return a[n];
}
void main( )
{ int n;
scanf("%d",&n);
printf("%d\n" ,fib( n ) );
}
ppt Fibonacii数列的第n项------动态规划DP,布布扣,bubuko.com
ppt Fibonacii数列的第n项------动态规划DP
标签:blog http io for 2014 amp log ef
原文地址:http://www.cnblogs.com/2014acm/p/3907894.html