Răspuns:
#include <iostream>
using namespace std;
int ogl(int n){
int og=0;
while(n)
og=og*10+n%10,n/=10;
return og;
}
int main(){
int a,b;
cin>>a>>b;
for(int i=a;i<b;++i)
for(int j=i;j<=b;++j){
if(i==ogl(j))
cout<<i<<" "<<j<<"\n";
}
}
Explicație: