题目
AC代码
#include<bits/stdc++.h>
using namespace std;
bool hw(char s[])
{
bool r=true;
int i;
for(i=0;i<strlen(s)/2;i++)
{
if(s[i]!=s[strlen(s)-i-1])
{
r=false;
break;
}
}
return r;
}
int main()
{
char s[1005];
gets(s);
while(hw(s)==true&&strlen(s)%2==0)
{
s[strlen(s)/2]='\0';
}
cout<<strlen(s)<<endl;
}