COMPARTE ESTE ARTÍCULO

Por aquí dejo cómo podemos saber si un numero es palindromo en C++:

#include <iostream>
#include <string>
#include <algorithm>

using namespace std;


int main()
{
    string str1;
    cout<<"Dígame la variable"<<endl;
    cin>>str1;
    string reves = str1;
    reverse(reves.begin(), reves.end());    
    if (str1== reves)
    {
        printf("Es palindromo");
    }else{
        printf("No es palindromo");
    }
}


NUESTRAS ÚLTIMAS PUBLICACIONES


Contenido restringido

Acceso de usuarios existentes
   
Registro de un nuevo usuario
*Campo necesario

Tags:

Comments are closed

Estado de acceso
ESTADO DE ACCESO
TRADUCTORES
COMPARTENOS
error: CONTENIDO PROTEGIDO