Bases and bars

Write a program that, given two numbers n and b, prints the digits of n
in base b as shown in the examples. For every digit d, print a line with
d capital exes. Print the digits from right to left.

Input

Input consists of a natural number n between 1 and 10⁶, followed by a
natural number b between 2 and 100.

Output

For every digit d of n represented in base b, and starting from the
digit with less weight, print a line of size d made up of only ‘X’.
Print a line with 10 dashes at the beginning and at the end of the
output.

Problem information

Author: Unknown
Translator: Salvador Roura

Generation: 2026-01-25T11:13:25.362Z

© Jutge.org, 2006–2026.
https://jutge.org
