解题思路: 如果是回文,那么字符串 正序 和 逆序 必定是一样的,不要考虑 左右对称,容易误导人
方法很简单,截取 字符串 翻转并 前后对比,相等就是了

include<bits/stdc++.h>

using namespace std;

int main()
{
string str ,temp ;
int len=0;
while(cin >> str)
{
len=0;
for(int i=0; i<str.length(); i++)
{
for(int j =str.length()-i; j>=2 ;j--)
{
string chart = str.substr(i,j);
temp = chart;
reverse(chart.begin(), chart.end());

            if(chart == temp  && temp .length() >=len)
            {
                len = temp .length();
            }
        }
    }

    cout << len <<endl  ;
}

return 0;
}