您的位置:首页 > 其它

[置顶] 判断一个数是否返回回文数,(回文数也是一个数字,即正反序是同一个数)

2016-10-25 20:29 337 查看
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
int main()
{
int i=0;
int m,n,a,b=0;
printf("please enter the number:");
scanf("%d",&i);
printf("%d\n",i);

for(;i<10||i>99999;)
{
printf("please again enter the number:\n");
scanf("%d",&i);
}
n=i%10;
m=i/10000;
a=(i/10)%10;
b=(i/1000)%10;
if(n==m&&a==b)
printf("the number is huiwen:%d\n",i);
else
printf("the number is not huiwen:%d\n",i);

system("pause");
return 0;
}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐