判断是否回文字符串练习题
#include "pch.h"
#include <iostream>
#include "stdio.h"
#include "string"
using namespace std;
int main()
{
string str;
cin >> str;
for (int i = 0; i < str.size() / 2; i++)
{
if (str[i] != str[str.size() - 1 - i])
{
cout << "不是回文字符串" << endl;
return false;
}
}
cout << "是回文字符串" << endl;
}