int num = Convert.ToInt32(Console.ReadLine());
int min = 0, max = num;

while (max > 0)
{
    min = min * 10 + max % 10;
    max = max / 10;
}

if(min == num)
    Console.Write("是回文数");
else
    Console.Write("不是回文数");

版权声明:本文为small-c原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/small-c/archive/2012/09/09/2677880.html