Tema: Ayuda
Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/08/2008, 14:27
yackcae
 
Fecha de Ingreso: junio-2008
Mensajes: 63
Antigüedad: 15 años, 11 meses
Puntos: 2
Respuesta: Ayuda

Los problemas están en:
"(j == false)" debería ser "(j == true)"
y
"if(palabra[i] =! palabra[(k-1) - i])" debería ser "if(palabra[i] != palabra[(k-1) - i])"

Código con las correcciones:
Código:
bool Palindromo(char *palabra, int k)
{
bool j = true;
for(int i=0; i<k/2 && (j == true); i++)
{
if(palabra[i] != palabra[(k-1) - i])
j = false;
}
if(j == true)
return true;
else
return false;
}