12345678910111213141516171819202122232425262728
#include <iostream> using namespace std; int main() { int n, m, d, r=0; cout<<"Enter a positive number: "<<endl; cin>>n; while(n>0) { n=m; while(n!=0) { d=n%10; r=(r*10)+d; n=n/10; if(r==m) { cout<<m<<" is a palindrome."<<endl; m--; } } } cout<<endl; system("pause"); return 0; }