Advertisement
MaxObznyi

Q.23

Nov 17th, 2019
188
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.33 KB | None | 0 0
  1. #include <iostream>
  2. #include <string>
  3. #include <algorithm>
  4. using namespace std;
  5.  
  6. bool isPalindrome(string s) {
  7. string t = s;
  8. reverse(t.begin(), t.end());
  9. return t == s;
  10. }
  11.  
  12. int main()
  13. {
  14. string s;
  15. cin >> s;
  16. if (isPalindrome(s))
  17. cout << "Yes";
  18. else
  19. cout << "No";
  20. return 0;
  21. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement