您的位置:首页 > 其它

杭电ACM 第2029题

2018-03-10 15:14 211 查看
#include<iostream>
#include<string>
using namespace std;
void main(){
unsigned n;
while(cin>>n){
bool q=true;
while(n--){

char s[99];
if(q){
q=false;
getchar();
}
gets(s);
bool t=true;
int i=0;
int j=strlen(s)-1;
for(;i<=j;++i,--j){
if(s[i]!=s[j]){
t=false;
break;
}
}
if(t)
cout<<"yes"<<endl;
else
cout<<"no"<<endl;

}
}
}

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  算法