#include<iostream>
#include<string>
using namespace std;
int is_parnumber(const string s)
{
size_t s_size = s.size();
for (size_t i=0;i<s_size;++i)
{
if (s[i] != s[s_size -1 - i])
return 0;
}
return 1;
}
int main()
{
string s;
cin >> s;
int b = is_parnumber(s);
if (b == 1)
cout << "yes";
else
cout << "no";
return 0;
}
判断字符串是否为回文
最新推荐文章于 2022-02-10 14:02:17 发布