#include
int main()
{
int q,b,n=0;
printf("1000到9999之间的回文数有:\n");
for(q=1;q<10;q++)
{
for(b=0;b<10;b++)
{
n++;
printf("%d ",1001*q+110*b);
}
}
printf("\n共%d个\n",n);
return 0;
}
#include
void main() { int i,j,k,n;
for ( i=1000,n=0;i<10000;i++ ) {
j=i; k=0; while ( j ) { k*=10; k+=j%10; j/=10; }
if ( i==j ) n++;
}
printf("%d\n",n);
}