Answer the question
In order to leave comments, you need to log in
How to solve a similar problem in Python?
A fairly simple algorithm.
The task itself is as follows:
Two numbers are given: a and b (entered in decimal notation). Find the value of the number a/b written in the k-ary number system. If a/b is a periodic fraction, then the period should be enclosed in parentheses.
Sample input:
1 2 8
1 12 10
Sample output:
0.4
0.08(3)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question