>>706
#include<stdio.h>
void function(int p,int n);

char str1[7];
char str2[6][3]={"bc","dc","de","ef","f",""};

int main(void){
function(0,0);
return(0);
}

void function(int p,int n){
int i;

str1[n] = p + 'a';
str1[n+1] = '\0';
 
if(p != 5)
{
for(i=0;str2[p][i] != '\0';i++)
function(str2[p][i]-'a',n+1);
}
else
printf("%s\n",str1);
}

こんな感じでどうでしょうか
アルゴリズムとか調べず直感で作ったので自信薄ですが