2个回答
展开全部
#include <stdio.h>
int main(int argc, char const *argv[])
{
int n = 0, n1 = 0;
int i = 0, j = 0;
char buf[6] = {0};
while(1)
{
scanf("%d",&n);
if(n <= 0 || n >= 100000)
printf("Error is n,pls try again.\n");
else
break;
}
n1 = n;
while(n1)
{
buf[i] = n1 % 10;
n1 /= 10 ;
i++;
}
while(i--)
{
n1 *= 10;
n1 += buf[j];
j ++;
}
printf("n: %d n1: %d\n", n, n1);
if(n == n1)
printf("YES\n");
else
printf("NO\n");
return 0;
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询