为什么最后输出结果会是0?当被调函数中的if语句不成立时不想要它返回该如何?

#include<stdio.h>

char a[15];
int count=0;

int fun(int store,int flower,int wine,int i)
{
    if(store>5 || flower>10)
        return 0;
    else if(store==5 && flower==10 && i==15)
    {
        if(wine==0 && a[14]=='b')
        {
            count++;
        }
    }
    a[i]='a';
    fun(store+1,flower,wine*2,i+1);
    a[i]='b';
    fun(store,flower+1,wine-1,i+1);
    return count;
}

void main()
{
    printf("%d\n",fun(0,0,2,0));
} 
    题目描述:

话说大诗人李白,一生好饮。幸好他从不开车。 无事街上走,提壶去打酒。
逢店加一倍,遇花喝一斗。
这一路上,他一共遇到店5次,遇到花10次,已知最后一次遇到的是花,他正好把酒喝光了。

请你计算李白遇到店和花的次序,可以把遇店记为a,遇花记为b。则:babaabbabbabbbb 就是合理的次序。像这样的答案一共有多少呢?请你计算出所有可能方案的个数(包含题目给出的)。

为什么最后输出结果会是0?当被调函数中的if语句不成立时不想要它返回该如何?

不需要具体方案的程序见下面代码。
如需要打印具体方案,参见我的博客(可能还在待审状态,csdn发个博客真费劲):

 #include <string.h>
#include <stdio.h>
#include <stdlib.h>

int fun(int store,int flower,int wine)
{
    if(store>5 || flower>10)
        return 0;
    else if(store==5 && flower==9 && wine==1)
    {
        return 1;
    }
    int re=0;
    re+=fun(store+1,flower,wine*2);
    re+=fun(store,flower+1,wine-1);
    return re;
}

void main()
{
    printf("一共%d个方案\n\n",fun(0,0,2));
}

设计有问题
fun函数最后没有返回值。

count定义应该在函数的内部