Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <string>
- using namespace std;
- int main(){
- string str;
- cin >> str;
- for(int i = 1; i <= str.length(); i++){
- if(tolower(str[i-1]) == tolower(str[str.length()-i])) {continue;}
- else {
- cout<<str<<" is not a palindrom"<<endl;
- return 0;
- }
- }
- cout<<str<<" is a palindrom."<<endl;
- return 0;
- }
Add Comment
Please, Sign In to add comment