Run ID:2799
提交时间:2024-02-29 21:04:56
#include<iostream> using namespace std; int main(){ int n; cin>>n; for(int i=1;i<=n;i++){ if(i<10) cout<<i<<endl; if(i<100&&i>=10){ if(i==i%10*10+i/10%10) cout<<i<<endl; } if(i<1000&&i>=100){ if(i==i%10*100+i/10%10*10+i/100%10) cout<<i<<endl; } if(i<10000&&i>=1000){ if(i==i%10*1000+i/10%10*100+i/100%10*10+i/1000%10) cout<<i<<endl; } if(i<100000&&i>=10000){ if(i==i%10*10000+i/10%10*1000+i/100%10*100+i/1000%10*10+i/10000%10) cout<<i<<endl; } } return 0; }