Created
April 17, 2015 20:41
-
-
Save samir96/62f0d47ee220703c6653 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
//Jorge Samir Godinez Lara/ A01630155 | |
#include <iostream> | |
using namespace std; | |
bool Palindromo(string cadena, int size){ | |
for(int i = 0; i < size/2; i++) | |
if(cadena[i] != cadena[size-i-1]) | |
return false; | |
return true; | |
} | |
int main(){ | |
string cadena; | |
cout << "Ingresa la palabra: "; | |
cin>>cadena; | |
Palindromo(cadena,cadena.length()) ? | |
cout << "\nEs palindromo \n" : cerr << "\nNo es palindromo \n"; | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment