#include<bits/stdc++.h> using namespace std; int main(){ for(int i=1000;i<=9999;i++){ int a,b,c,d; a=i%10; b=i/10%10; c=i/100%10; d=i/1000%10; if(a==d&&b==c){ cout<<i<<endl; } } return 0; }
By signing up a 追梦算法网 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 追梦算法网 universal account