Guest User

Untitled

a guest
Feb 19th, 2018
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.32 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. using namespace std;
  4.  
  5. int main(){
  6. string str;
  7. cin >> str;
  8. for(int i = 1; i <= str.length(); i++){
  9.  
  10. if(tolower(str[i-1]) == tolower(str[str.length()-i])) {continue;}
  11. else {
  12. cout<<str<<" is not a palindrom"<<endl;
  13. return 0;
  14. }
  15. }
  16. cout<<str<<" is a palindrom."<<endl;
  17. return 0;
  18. }
Add Comment
Please, Sign In to add comment