Mein Lösungsvorschlag:
#include <algorithm>
#include <iostream>
#include <cctype>
using namespace std; 
int main() {
    cout << "Text: ";
    string s;
    getline(cin, s);
    
    string p(s.size(), 0);
    auto e = copy_if(s.begin(), s.end(), p.begin(), ::isalpha);
    p.resize(e - p.begin());
    
    cout << "Gefiltert: " << p << endl;
    cout << "Länge: " << p.size() << endl;
    
    string q = p;
    reverse(q.begin(), q.end());
    cout << "Gedreht: " << q << endl;
    transform(p.begin(), p.end(), p.begin(), ::tolower);
    transform(q.begin(), q.end(), q.begin(), ::tolower);
    if (q == p) {
        cout << "Der Text ist ein Palindrom" << endl;
    } else {
        cout << "Der Text ist kein ein Palindrom" << endl;
    }
}
Ich hoffe, die Aufgabe war nicht dafür vorgesehen, den Umgang mit Schleifen zu üben.