P0018. Azathoth numbers

In the center of the universe the origin of the chaos resides: a blind
and crazy god called Azathoth. In his madness, Azathoth writes the
numbers in basis 50, and each of the digits in basis 50 is written in
binary basis. Moreover, he writes a dot in the beginning, in the end and
between each digit.

For instance, 115 = 2 ⋅ 50¹ + 15 ⋅ 50⁰. As 2 in binary basis is |10|,
and 15 in binary basis is |1111|, Azathoth would write “|.10.1111.|”.

Your task is to write a program that prints each given number with the
Azathoth system.

Observation

Your program must implement and use the procedure

        void binary_print(int n);

that prints any natural number |n| in binary (zero included).

Hint

Use recursion.

Input

The input is a sequence of natural numbers.

Output

Your program must print each natural number in decimal and also in
Azathoth system one per line and following the format of the instances.

Problem information

Author: Unknown
Translator: Carlos Molina

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

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