1 //題目:一個5位數,判斷它是不是回文數。即12321是回文數,個位與萬位相同,十位與千位相同。
2 #include <stdio.h>
3
4 int main()
5 {
6 int num=0;
7 printf("please input a int num:");
8 do{
9 if(num!=0)
10 {
11 if(num<10000)
12 printf("so,input a bigger one:");
13 else
14 printf("so ,input a smaller one:");
15 }
16 scanf("%d",&num);
17 }while(num>99999||num<10000);
18
19 if((num/10000==num%10) && (num/1000%10==num%100/10))
20 printf("Yes,it is!\n");
21
22 else
23 printf("No,it isn't!\n");
24
25 return 0;
26 }
摘自 zhengmian