判断是不是回文数
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
补充:软件开发 , C语言 ,