--Originally published at how not to program
Here is an other guess the code, guess what the code do in the comments
#include <iostream>
#include <string>
using std::string;
using std::cout;
using std::cin;
using std::endl;
int main(){
string palabra, alreves, respuesta;
cout << “Dame la palabra ” << endl;
cin >> palabra;
// cout << palabra;
int tamano = palabra.length();
for(int i = tamano-1; i>=0; i–){
// cout << palabra[i];
alreves = alreves + palabra[i];
}
cout << alreves << endl;
if(palabra == alreves)
{
cout << “Es palindromo ” << endl;
}
else
{
cout << “No es palindromo ” << endl;
}
}