fork download
  1. #include <iostream>
  2. #include<string>
  3. using namespace std;
  4.  
  5. int main() {
  6. string s;
  7. cin>>s;
  8. bool b=0;
  9. for(int i=0;i<=s.length()/2;i++)
  10. {
  11. if(s[i]!=s[s.length()-i-1])
  12. {
  13. b=1;
  14. break;
  15. }
  16. }
  17. if(b==1)
  18. cout<<"NO";
  19. else
  20. cout<<"YES";
  21. return 0;
  22. }
Success #stdin #stdout 0s 15232KB
stdin
Standard input is empty
stdout
YES