Proszę wykonać zadanie z załącznika w języku c++.

Odpowiedź:
#include <iostream>
#include <string>
#include <algorithm>
int main() {
std::string word;
std::getline(std::cin, word);
word.erase(std::remove_if(word.begin(), word.end(), [](char a){return !std::isalpha(a);}), word.end());
std::transform(word.begin(), word.end(), word.begin(),
[](char a){return std::tolower(a);});
std::cout << std::equal(word.begin(), word.begin() + word.length() / 2, word.rbegin());
return 0;
}
Wyjaśnienie:
1 jest palindromem 0 nie jest