/*__________________________________________________

   Libro: EMPEZAR DE CERO A PROGRAMAR EN LENGUAJE C
   Ejemplo 12.5: Signo del zodíaco
                 (Solución 2)
                 
   Web del Autor: http://www.carlospes.com
  __________________________________________________*/

#include <stdio.h>
#include <string.h>

int main()
{
   int numero;
   char categoria[7];

   printf( "\n   Listado de signos del zodiaco:" );
   printf( "\n\n   1. Aries" );
   printf( "\n   2. Tauro" );
   printf( "\n   3. Geminis" );
   printf( "\n   4. Cancer" );
   printf( "\n   5. Leo" );
   printf( "\n   6. Virgo" );
   printf( "\n   7. Libra" );
   printf( "\n   8. Escorpio" );
   printf( "\n   9. Sagitario" );
   printf( "\n   10. Capricornio" );
   printf( "\n   11. Acuario" );
   printf( "\n   12. Piscis" );
   printf( "\n\n   Introduzca numero de signo: " );

   scanf( "%d", &numero );

   switch ( numero % 4 )
   {
      case  1 : strcpy( categoria, "Fuego" );
                break;
      case  2 : strcpy( categoria, "Tierra" );
                break;
      case  3 : strcpy( categoria, "Aire" );
                break;
      case  0 : strcpy( categoria, "Agua" );
   }

   if ( numero >= 1 && numero <= 12 )
      printf( "\n   Es un signo de %s.", categoria );
   else
      printf( "\n   ERROR: %d no esta asociado a ningun signo.", numero );

   return 0;
}
