Advertisement
Guest User

Untitled

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