(void)Р{Р int peach[50]={0};Р int i=0,j=0;Р peach[DAYS-1]=1; //最后一天的桃子数Р for(i=DAYS ; i>0; --i , j=i-1)Р {Р peach[j] = 2*(peach[i] + 1);Р }Р Р printf("* * * * * * * * * * * * * * * * * * * * *\n");Р printf("* 数组法* \n");Р printf("* 这群猴子共摘了%d 个桃子*\n",peach[0]);Р printf("* * * * * * * * * * * * * * * * * * * * *\n");Р}Рvoid peach_2(stack *s)Р{Р int i=0;Р int num=0;Р Push(s,1); //先把最后一天的桃子数进栈Рi++;Р Р while(i < DAYS)Р {Р Pop(s,num);Р Push(s,num);Р i++;Р}Р printf("* * * * * * * * * * * * * * * * * * * * *\n");Р printf("* 链表法* \n");Р printf("* 这群猴子共摘了%d 个桃子*\n",num);Р printf("* * * * * * * * * * * * * * * * * * * * *\n");Р}Рvoid peach_3(int n,int i)Р{Р if(i ==DAYS) //DAYS 为递归终止条件由用户给出Р {Р printf("* * * * * * * * * * * * * * * * * * * * *\n");Р printf("* 递归法* \n");Р printf("* 这群猴子共摘了%d 个桃子*\n",n);