Advertisement
Guest User

Untitled

a guest
Sep 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.46 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <cstdio>
  4. #include <cctype>
  5. #include <algorithm>
  6.  
  7. using namespace std;
  8.  
  9. int main()
  10. {
  11.     freopen("input.txt", "r", stdin);
  12.     freopen("output.txt", "w", stdout);
  13.     string s, s1;
  14.     getline(cin, s1);
  15.     for (size_t i = 0; i < s1.length(); ++i) {
  16.         if (isalpha(s1[i])) {
  17.             s += s1[i];
  18.         }
  19.     }
  20.     s1 = s;
  21.     reverse(s.begin(), s.end());
  22.     if (s == s1) {
  23.         cout << "YES\n";
  24.     } else {
  25.         cout << "NO\n";
  26.     }
  27.     return 0;
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement