/* Algorismo que nos mostrará un rombo */ /* Ejercicio 30

Anuncio
/* Algorismo que nos mostrará un rombo */
/* Ejercicio 30 */
/* Variables y constantes */
#include <stdio.h>
#define max 11
void main ()
{
int i;
int j;
for (i=1; i<=max; i++)
{
for (j=1; j<=max; j++)
{
if (j-i <= max/2 && i-j <= max/2 && j+i <= (3*max/2)+1
&& j+i >= (max/2+2))
printf("\033[0;42;32m O\033[32;0m");
else
printf(" X");
}
printf("\n");
}
}
Descargar