数字逆序

if(x2 >= 10)
{
    while(x2 >= 10)
    {
        y2 = y2 * 10 + x2%10;
        x2 = x2/10;
    }
    y2 = y2 * 10 + x2;
}
else
{
    y2 = x2;
}

 

posted @ 2022-07-05 16:07  西北小蚂蚁  阅读(27)  评论(0编辑  收藏  举报