逐一从开头与末尾比较字符是否相等
#include<iostream>
#include<cstdio>
#include<cmath>
#include<string>
using namespace std;
int main(){
int n;
cin >> n;
int i,j,k;
string x;
for( i = 0; i < n; i++){
cin >> x;
k = 0;
for( j = 0; j != (x.size() + 1) / 2;j++){
if(x[i] != x[x.size() - 1 - i]){
k = 1;
break;
}
}
if(k == 0)cout << "yes" << endl;
else
cout << "no" << endl;
}
return 0;
}