#include <stdlib.h>
#include <stdio.h>
#define N 20
int main()
{
int i;
int fib[N] = {0, 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]);
if (i % 5 == 4)
{
printf("\n");
}
}
return EXIT_SUCCESS;
}
c语言实现斐波那契数列
最新推荐文章于 2023-10-31 11:28:12 发布