一、基本算法-尺取法判断回文串
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int main()
{
int n;
int i;
int j;
bool result = true;
string ch;
cin >> n;
while (n--)
{
cin >> ch;
i = 0;
j = ch.size()-1;
while (i < j)
{
if (ch[i] != ch[j]) { result = false; break; }
i++;
j--;
}
if (i >= j)
cout << "Yes" << endl;
else
cout << "No" << endl;
}
return 1;
}