10/07/01 23:05:13
>>390の前半
// ◎ソースコード
#include <stdio.h>
#define N 10
#define ID "/0000/"
#define NAME "/やまだ/"
static int fib(int n)
{
int r;
if (n <= 2)
r = 1;
else
r = fib(n - 1) + fib(n - 2);
return r;
}
//-----------------------------------------------------
int main(void)
{
int i;
printf("%s %s\n\n", ID, NAME);
for (i = 1; i <= N; i++) {
printf("F%2d = %7d\n", i, fib(i));
}
return 0;
}