ABC147B - Palindrome-philia
#include <iostream> #include <string> using namespace std; #define REP(i, n) for (int i = 0; i < (n); ++i) int main(void) { int ans = 0; string s; cin.tie(0); ios::sync_with_stdio(false); cin >> s; REP(i, s.length() / 2) { if (i != s.length() - 1 - i && s[i] != s[s.length() - 1 - i]) { ans++; } } cout << ans << "\n"; return 0; }