def reverse_num(n: int) ->int:
    """Reverses a number

    :param n: number to be reversed
    :type n: int
    :returns: reversed of a number
    :rtype: int

    .. doctest:: python

        >>> reverse_num(1)
        1
        >>> reverse_num(12345)
        54321
        >>> reverse_num(54321)
        12345
        >>> reverse_num(54321000)
        12345

    """
    reversed = 0
    while n > 0:
        reversed *= 10
        reversed += n % 10
        n //= 10
    return reversed
