1 3 2
1 3 2解题思路:斐波拉契数列的应用源代码:#include <stdio.h> #include <stdlib.h> int main() { int i,n; long long a[51]={0,1,2}; for(i=3;i<51;i++) a[i]=a[i-1]+a[i-2]; while(scanf("%d",&n)!=EOF) { printf("%I64d\n",a[n]); } system("pause"); return 0; }
原文地址:http://blog.csdn.net/zchlww/article/details/41596703