U
U
unit232015-10-24 23:17:06
Python
unit23, 2015-10-24 23:17:06

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

1 answer(s)
M
Mark Doe, 2015-10-24
@unit23

pastebin.com/68gSrJS4

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question