to find if a given string is palindrome or is not palindrome

前端 未结 9 556
悲哀的现实
悲哀的现实 2020-11-30 15:36

I made a program to find if a entered string is palindrome or not palindrome but it always says that its not a palindrome

#include  
#include          


        
9条回答
  •  攒了一身酷
    2020-11-30 16:06

    You can also use STL to check if a given string is palindrome using function equal. Lets say you have an std::string named x, then the following function call determines if x is palindrome

    equal(x.begin(), x.begin() + x.size() / 2, x.rbegin());
    

提交回复
热议问题