自己试了一下,按理说应该是很简单的,不过是新手吗#include<iostream>#include<conio.h>
using namespace std;
int Total_peach(int N){ int i; if(N==10) return 1; else { N++; return 2*(Total_peach(N)+1); } } int main(){ cout<<"The number of peach is :"<<Total_peach(1); getch(); return 0; }
int total = 1;for (int i = 9;i != 0;--i){ total = (total+1)*2;}