#include<iostream>
using namespace std;
int main(){
int n;
cin>>n;
char s[50];
cin.ignore();
while(n--){
gets(s);
int m =strlen(s);
int i=0,l=0,r=m-1;//record the position left and right of the array
if(m==2){
if(s[0]==s[1])
cout<<"yes"<<endl;
else
cout<<"no"<<endl;
}else{
for(;i<m/2;i++){
if(s[l] == s[r]){
r--;
l++;
}
}
if( l == r || l-1 == r){
cout<<"yes"<<endl;
}else{
cout<<"no"<<endl;
}
}
}
return 0;
}
HDU-2029
最新推荐文章于 2020-12-10 00:02:11 发布