The exercise asks the program to receive an integer n
and print a height drawing 2*n
as follows:
\ * /
\ *** /
\*****/
\***/
\*/
/*\
/***\
/*****\
/ *** \
/ * \
I've done the following so far:
void arte(int n)
{
int i, barrasE, aux, espacobarrasE, ebE, espaco;
aux = n;
for(i = 1; i <= n; i++)
{
if(aux < n) //Espaços impressos antes das contra barras na parte superior.
{
espacobarrasE = n - aux;
for(ebE = 0; ebE < espacobarrasE; ebE++)
printf(" ");
}
for(barrasE = 1; barrasE <= aux; barrasE++) //Desenha as contra barras na diagonal na parte superior.
{
printf("\");
break;
}
for(espaco = 1; espaco < n; espaco++)
{
printf(" ");
}
aux = aux - 1;
printf("\n");
}
}
But this only prints the counter bars above and I do not know how to continue. I would like to know the best way to continue.