You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
#include<bits/stdc++.h>
|
|
using namespace std;
|
|
int main() {
|
|
int i,m,k;
|
|
int a[4];
|
|
for(i=1000; i<10000; i++) //9000次循环
|
|
{
|
|
m=i;
|
|
k=0;
|
|
//再来4次
|
|
while(m) {
|
|
a[k]=m%10;
|
|
m=m/10;
|
|
k++;
|
|
}
|
|
if(a[0]==a[3]&&a[1]==a[2]) {
|
|
printf("%d\n",i);
|
|
}
|
|
}
|
|
return 0;
|
|
}
|
|
|
|
|
|
|