📜  bool checkPalindrome(string inputString) { return inputString == string(inputString.rbegin(), inputString.rend()); } - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:34.205000             🧑  作者: Mango

代码示例1
#include 
#include 

using namespace std;
bool checkPalindrome(string);
int main()
{
    string inputString = "palindrom";
    cout << checkPalindrome(inputString);
    return 0;
}

bool checkPalindrome(std::string inputString)
{
   return (inputString == string(inputString.rbegin(), inputString.rend()));
}