fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. bool isPalindrome(string s) {
  5. string str;
  6. string rev;
  7.  
  8. for(auto x :s){
  9. if(x>=65&&x<=122||x>=48&&x<=57){
  10. if(x>=65&&x<=90){
  11. str+=(x+32);
  12. }else{
  13. str+=x;
  14. }
  15. }
  16. }
  17.  
  18. rev=str;
  19. reverse(str.begin(),str.end());
  20.  
  21. return rev==str;
  22. }
  23.  
  24. int main(){
  25.  
  26. string s;
  27. getline(cin, s);
  28.  
  29. cout<<isPalindrome(s);
  30.  
  31. return 0;
  32. }
  33.  
Success #stdin #stdout 0.01s 5324KB
stdin
45
stdout
Standard output is empty