Home > Back-end >  To solve the urgent please please
To solve the urgent please please

Time:01-04

Write a program for 20 before the Fibonacci sequence, output four number per line

CodePudding user response:

Can participate

CodePudding user response:

. This kind of baidu, a lot of ~

CodePudding user response:

A lot of online, only supplies the reference:
 # include & lt; Stdio. H> 

Int fib (int n)
{
If (n & lt; 2) return n;
The else return fib (n - 1) + fib (n - 2);
}

Int main (void)
{
int i;
for(i=0; i<20; I++)
{
Printf (" % d % c ", fib (I), I % 4==3? '\ n' : '\ t');
}
return 0;
}
  • Related