c exercise language column summing the number 24--

. 1 #include <stdio.h>
 2 #include <stdlib.h>
 . 3  // Title: 2 / 1,3 / 2,5 / 3,8 / 5,13 / 8,21 / 13 ... This is obtained before the 20 columns of the sum 
. 4  int main () {
 . 5  int a, B, I, n-, T;
 . 6  a float S;
 . 7 the printf ( " Please enter the number of added items: " );
 . 8 Scanf ( " % D " , & n-);
 . 9 S = 0 ;
 10 A = 2 ;
 . 11 B = . 1 ;
 12 is  for (I = . 1 ; I <= n-; I ++ ) {
 13 is     s=s+a/b;
14     t=a;
15     a=a+b;
16     b=t;
17 }
18 printf("%f",s);
19 return 0;
20 }
21    

 

Guess you like

Origin www.cnblogs.com/gougouwang/p/11410403.html