c++源码
#include <iostream>
using namespace std;
int count1 = 0;
char a[15];
void fun(int store, int flower, int wine, int i)
{
if ((store > 5) || (flower > 10))
return;
else
if ((store == 5) && (flower == 10) && (i == 15))
if (a[14] == 'b' && wine == 0) count1++;
a[i] = 'a';
fun( store + 1, flower, wine * 2,i + 1);
a[i] = 'b';
fun( store, flower + 1, wine - 1,i+1);
}
int main(){
fun(0, 0, 2, 0);
cout << "方案个数:"<<count1;
return 0;
}