Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<iostream>
- #include<vector>
- #include<string>
- #include<cmath>
- #include<algorithm>
- using namespace std;
- bool check_polindrom(string word){
- int len = word.length();
- for (int i = 0; i < len / 2; i++)
- if (word[i] != word[len - i - 1])
- return false;
- return true;
- }
- int main() {
- string a;
- getline(cin, a);
- for (int i = 0; i < a.size(); i++) {
- string b = a;
- b.erase(i, 1);
- if (check_polindrom(b)) {
- cout << i + 1 << "\n";
- system("pause");
- return 0;
- }
- }
- cout << "0" << "\n";
- system("PAUSE");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement