斐波那契数列从第3项开始,每一项都等于前两项之和
#include <stdio.h>
int main()
{
int i;
int n = 10;//10项的斐波那契数列
int fib[10] = { 1,1 };//前两项
for (i = 2;i < n;i++)
fib[i] = fib[i - 1] + fib[i - 2];
for (i = 0;i < n;i++)
printf("%d, ", fib[i]);
return 0;
}