2025-03-06 22:46:33 +08:00

41 lines
932 B
C
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

/*-------------------------------------------------------
输出100-1000以内所有的回文数一行10个。(注每个数占5个字符
101 111 121 131 141 151 161 171 181 191
202 212 222 232 242 252 262 272 282 292
303 313 323 333 343 353 363 373 383 393
404 414 424 434 444 454 464 474 484 494
505 515 525 535 545 555 565 575 585 595
606 616 626 636 646 656 666 676 686 696
707 717 727 737 747 757 767 777 787 797
808 818 828 838 848 858 868 878 888 898
909 919 929 939 949 959 969 979 989 999
-------------------------------------------------------*/
#include <stdio.h>
main()
{
int i,s,t,k;
k=0;
/**********Program**********/
for(i=100;i<1000;i++){
s = 0;
t = i;
while(t){
s*=10;
s+=t%10;
t/=10;
}
if(s == i){
printf("%5d", i);
k++;
if(k%10==0){
printf("\n");
}
}
}
/********** End **********/
}