fork(112) download
  1. #include <string>
  2. #include <algorithm>
  3. #include <iostream>
  4. int main()
  5. {
  6. std::string s;
  7. std::cin >> s;
  8. if( equal(s.begin(), s.begin() + s.size()/2, s.rbegin()) )
  9. std::cout << "is a palindrome.\n";
  10. else
  11. std::cout << "is NOT a palindrome.\n";
  12. }
Success #stdin #stdout 0s 2860KB
stdin
radar
stdout
is a palindrome.