📜  java代码示例中数字的降序递归

📅  最后修改于: 2022-03-11 14:52:27.210000             🧑  作者: Mango

代码示例1
public static int reverseItRecursive(int number)
{
    if (number == 0)
        return 0;

    int n = number;
    int pow = 1;

    while (n >= 10)
    {
        n = n / 10;
        pow = pow * 10;
    }
    return (n + reverseItRecursive(number - n*pow)*10);
}