#include<bits/stdc++.h>
using namespace std;
int n;
int p,q;
int a,b,c,d,e,f;
int main(){
scanf("%d",&n);
p=10000;
while(p<1000000){
a=p/10000;
b=p%10000/1000;
c=p%1000/100;
d=p%100/10;
e=p%10;
if(a==e&&b==d&&a+b+c+d+e==n){
cout<<a<<b<<c<<d<<e<<endl;
}
p++;
}
q=100000;
while(q<1000000){
a=q/100000;
b=q%100000/10000;
c=q%10000/1000;
d=q%1000/100;
e=q%100/10;
f=q%10;
if(a==f&&b==e&&c==d&&a+b+c+d+e+f==n){
cout<<a<<b<<c<<d<<e<<f<<endl;
}
q++;
}
return 0;
}
试题 基础练习 特殊回文数
最新推荐文章于 2023-01-12 16:28:57 发布