Codeforces-Round-410#A-Mike and palindrome
Mike and palindrome
time limit per test 2 second memory limit per test 256 megabytes
Mike has a string s consisting of only lowercase English letters. He wants to change exactly one character from the string so that the resulting one is a palindrome.
A palindrome is a string that reads the same backward as forward, for example strings “z”, “aaa”, “aba”, “abccba” are palindromes, but strings “codeforces”, “reality”, “ab” are not.
The first and single line contains string s (1≤|s|≤15).
Print "YES" (without quotes) if Mike can change exactly one character so that the resulting string is palindrome or "NO" (without quotes) otherwise.
这里的回文串是必须替换一个字符是否能形成回文 那么头和尾双指针扫一遍，如果不同处只有1处，那就可以 还有一种情况，那就是没有不同处，但字符串的长度是奇数，那么可以改中间那个字符达成。## AC code:(不包含输入类)