#include<iostream>
using namespace std;
int main() {
char str[100];
int len = 0;
bool flag = true;
cout << "please cin a str" << endl;
int i = 0;
str[i] = getchar();
while (str[i] != '\n')
{
i++;
str[i] = getchar();
}
len = i - 1;
for (int j = 0; j < (len / 2); j++)
{
if (str[j] != str[len - j])
{
flag = false;
break;
}
}
if (false == flag)
{
cout << "不是回文" << endl;
}
else
{
cout << "是回文" << endl;
}
system("pause");
return 0;
}
博客围绕判断是否为回文展开,但具体判断对象及方法因内容缺失暂不明确。回文判断在信息技术领域有一定应用,如文本处理等。
494

被折叠的 条评论
为什么被折叠?



