从键盘中输入99999以内的数,要先判断是几位数哦,再判断是不是回文数

大哥大姐有没有人讲详细点的,我想教下,从键盘中输入99999以内的数,要先判断是几位数哦,再判断是不是回文数
最新回答
守护爱人找到爱人

2024-05-30 12:31:40

#include"stdio.h"
main()
{int a,ge,shi,bai,qian,wan;
printf("input the number:\t");
scanf("%d",&a);
if(a>=10000)
printf("it's a 5 wei number\n");
else if(a>=1000)
printf("it's a 4 wei number\n");
else if(a>=100)
printf("it's a 3 wei number\n");
else if (a>=10)
printf("it's a 2 wei number\n");
else printf("ok,it's just a 1 wei number\n");
wan=a/10000;
qian=(a%10000)/1000;
bai=(a%1000)/100;
shi=(a%100)/10;
ge=(a%10);
if(wan==ge&&qian==shi)
printf("it's a hui wen\n");
else printf("it's not a hui wen\n");
while(1);
}