Fibonacci 数
#include "stdio.h"
#include "math.h"
int main(void)
{
int i, m, n;
int repeat, ri;
long f;
long fib(int n);
scanf("%d",&repeat);
for(ri = 1; ri <= repeat; ri++){
scanf("%d%d", &m, &n);
for(i=1;i<=n;i++)
{
f = fib(i);
if(f>=m && f<=n) printf("%ld ", f);
}
printf("\n");
}
}
long fib(int n)
{
int i, a[n];
if(n==1 || n == 2) return 1;
a[1] = 1;
a[2] = 1;
for(i = 3;i<=n;i++)
a[i] = a[i-1] + a[i-2];
return a[i-1];
}