数学趣题——猴子吃桃问题

an / 2 – 1 = an+1

   1: #include <stdio.h>
   2:  
   3: int main()
   4: {
   5:     int sum = 1, i;
   6:     for (i = 9; i >= 1; i--)
   7:     {
   8:         sum = (sum + 1) * 2;
   9:     }
  10:     printf("the num of peace are %d\n", sum);
  11:     return 0;
  12: }

你可能感兴趣的:(问题)