1040

#include
#include
using namespace std;
int main()
{
	string a;
	getline(cin, a);
	int L = a.length();
	int max = 1;
	int i, j, t;
	t = 0;
	while (t < L)
	{
		i = t - 1;
		j = t + 1;
		while (i>=0&&j max)
					max = j - i + 1;
				i--;
				j++;
			}
			else
				break;
		}
		i = t;
		j = t + 1;
		while (i >= 0 && j max)
					max = j - i + 1;
				i--;
				j++;
			}
			else
				break;
		}
		t++;
	}
	cout << max << endl;
	system("pause");
	return 0;
}

 

你可能感兴趣的:(PAT-A)