int n, nrcif = 0, temp;
cin>>n;
bool ok = true;
temp = n;
while(temp){
temp/=10;
nrcif *= 10;
}
while(nrcif > 9 && ok){
if(n%10 != n/nrcif )
ok = false;
n = n%(nrcif/10);
n/=10;
nrcif/=100;
}
if(ok) cout<<"palindrom";
Cred ca asta ar fi, scuze daca e vre-o eroare, nu am verificat in codeblocks.