Programming seeking Fibonacci sequence 1,1,2,3,5,8 ,. . . The former 20, the output 10 requires each line number.

#include <stdio.h>
void main ()
{
int I, F1, F2, F;
F1 = F2 =. 1;
the printf ( "%% 6D 6D", F1, F2); // first output of the first two columns //


for (I =. 3; I ++; I <= 20 is)
{
F = F1 + F2;
the printf ( "% 6D", F);
IF (I% 10 == 0)
the printf ( "% \ n-"); // no output after the line feed 10 //
F1 = F2;
F2 = F;
}
}

Guess you like

Origin www.cnblogs.com/zhangdemingQ/p/12096190.html