Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <vector>
- #include <algorithm>
- using namespace std;
- int main() {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- ios_base::sync_with_stdio(false);
- string str;
- cin >> str;
- int n = str.length();
- int counter = 0;
- for (int i = 0; i < n / 2; i++) {
- if (str[i] != str[n - i - 1]) {
- counter++;
- }
- }
- if (counter != 0) {
- counter -= 1;
- }
- cout << counter;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement