C++猴子偷桃子算法
#include <iostream>
using namespace std;
int GetPeach(int nDay)
{
if(nDay == 11)
{
return 1;
}
return (GetPeach(nDay + 1) + 1) * 2;
}
void main()
{
int nTotal = 0;
nTotal = GetPeach(1);
cout << nTotal << endl;
cout << "Hello World" << endl;
int wait;
cin >> wait;
}