分解出个位,十位,千位和万位的数字.
#include <stdio.h>
void main()
{
long ge, shi, qian, wan, x;
printf("Please enter a five-digit number: ");
scanf("%ld",&x);
wan=x/10000;
qian=x%10000/1000;
shi=x%100/10;
ge=x%10;
if(ge == wan && shi == qian) /*个位等于万位并且十位等于千位*/
printf("This number is a HuiWen.\n");
else
printf("This number is not a HuiWen.\n");
}
请放心使用,有问题的话请追问
采纳后你将获得5财富值.
你的采纳将是我继续努力帮助他人的最强动力!