#include <stdio.h>
void step(char out[], int level, int depth)
{
static const char data[]="AEIOUY";
const int SIZE= sizeof(data)/sizeof(data[0])-1;
for (int i=0; i<SIZE; i++)
{
out[level]=data[i];
if( level==depth-1)
printf("%s\n",out);
else
step(out, level+1, depth);
}
}
int main()
{
int depth = 0;
do
{
printf("Please insert sequence length\n");
if (scanf("%d", &depth) != 1)
depth=0;
} while ( depth < 1 || depth > 20);
char * out = new char[depth+1];
memset(out, 0, depth+1);
step(out, 0, depth);
delete [] out;
return 0;
}
:)