Created
May 3, 2016 17:08
-
-
Save alonzoibarra97/76f310bc9eabe845241435cc65b7cbe1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <string> | |
using namespace std; | |
int i; | |
int main(){ | |
string cadena, cadenain; | |
cout<<"Give one word and i will tell you if it is a palindrome or not\n"; | |
getline(cin,cadena); | |
for(i= cadena.size()-1; i>=0; i--){ | |
cadenain+= cadena.at(i); | |
} | |
if(cadena==cadenain) | |
{ | |
cout<<"This string is a palindrome"; | |
} | |
else{ | |
cout<<"This string is not a palindrome"; | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment