#include<stdio.h>
char a[99],s[99];
int len;
void hui(int y){
int u;
int top=0;
for(u=0;u<=y;u++){
s[++top]=a[u];
}
if(len%2==0){
y=y+1;
}else{
y=y+2;
}
for(u=y;u<len;u++){
if(a[u]!=s[top])
break;
top--;
}
if(top==0)
{printf("YES!");
}else{
printf("NO!");
}
getchar();getchar();
}
int main(){
gets(a);
len=strlen(a);
int k=len/2-1;
hui(k);
return 0;
}
输出结果:
hui
NO!
oppo
YES!