EI: juntando mensajes.
Aqui el ejercicio. Me gustaría que le dieran mejoras.

Código
#include <iostream>
using namespace std;
int n;
bool palindromo(char _vec[100]);
int main()
{
bool z;
char _text[100];
cout << "Ingrese cadena" << endl;
cin.get(_text,sizeof(_text));
n=strlen(_text)+1;
int isp=1;
while(isp<n)
{
if(_text[isp]==32)
{
for(int i=isp;i<n;i++)
{
_text[i]=_text[i+1];
}
n--;
}
isp++;
}
z=palindromo(_text);
if(z){cout<<"Es palindromo"<<endl;}
else{cout<<"No es palindromo"<<endl;}
system("pause");
return 0;
}
bool palindromo(char _vec[100])
{
int i=0;
bool e=0;
while(e==0 && i<n/2)
{
if(_vec[i]!=_vec[n-i-2]){e=1;}
else{i++;}
}
if(e==0){return 1;}
else{return 0;}
}










Autor



En línea



Sorprendido! Muchas gracias.








