特殊回文数
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <string>
#include <cstring>
#include <cctype>
using namespace std;
const double PI=3.14159265358979323;
const int maxn=100010;
int IsBackSrting(int n){
int a1=n%10,
a2=n/10%10,
a3=n/100%10,
a4=n/1000%10,
a5=n/10000%10;
if(n>=10000&&n<=99999){
if(a1==a5&&a2==a4) return 1;
return 0;
}else if(n>=100000&&n<=999999){
int a6=n/100000%10;
//cout<<a1<<" "<<a2<<" "<<a3<<" "<<a4<<" "<<a5<<" "<<a6<<endl;
if(a1==a6&&a2==a5&&a3==a4){
return 1;
}else {
return 0;
}
}
return 0;
}
int GetSum(int n){
int a1=n%10,
a2=n/10%10,
a3=n/100%10,
a4=n/1000%10,
a5=n/10000%10;
if(n>=10000&&n<=99999){
return a1+a2+a3+a4+a5;
}else if(n>=100000&&n<=999999){
int a6=n/100000%10;
return a1+a2+a3+a4+a5+a6;
}
return 0;
}
int main(){
int n;
cin>>n;
//cout<<IsBackSrting(n)<<" "<<GetSum(n)<<endl;
for(int i=10000;i<=999999;i++){
if(IsBackSrting(i)&&GetSum(i)==n) cout<<i<<endl;
}
return 0;
}