Probleme generateur de possibilité
Bonjour,
Voila j'ai un probleme que je n'arrive pas a trouver la solution
le code et la :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
char combi[] = "abcdefghijklmnopqrstuvwxyz";
void combi(char * str, char * tmp, int len, int ind) {
int i;
if (ind >= len) {
printf("%s\n",tmp);
return;
}
for (i = 0; i < strlen(combi); i++) {
tmp[ind] = str[i];
combi(str, tmp, len, ind+1);
}
}
int main()
{
int len = 6;
char * tmp = calloc(len + 1, sizeof(char));
faire_combi(combi, tmp, len, 0);
} |
le probleme ça marche bien
aaaaaa
aaaaab
...
zzzzzzz
mais je chercher une solution pour commencer ou je veux
par example a naaaaa puis naaaab etc et pas a aaaaaa aaaaab
des idées ?
merci :-)