include iostream include stdio include string using namespace std int

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int is_palindrom(string name, int i, int n) {
if (name[i] != name[n - 1 - i]) return 0;
if (i == (int) (n / 2)) return 1;
i++; is_palindrom(name, i, n);
}
int main() {
setlocale(LC_ALL, "Russian");
string name;
cout << "Введите строку: ";
cin >> name;
int res = is_palindrom(name, 0, name.length());
cout << res;
return 0;
}