数学趣题——棋盘放麦粒

   1: #include <stdio.h>
   2: #include <math.h>
   3:  
   4: int main()
   5: {
   6:     double sum = 0;
   7:     int i;
   8:     for (i = 1; i <= 64; ++i)
   9:     {
  10:         sum += pow(2, i-1);
  11:     }
  12:     printf("the sum is \n%f\n", sum);
  13:  
  14:     return 0;
  15: }

你可能感兴趣的:(数学)