The input consists of one or more lines, each containing a pair of
positive integers less than 32768, separated by a space. The first number
is the numerator n and the second is the denominator d. For each
line of input, display the decimal equivalent of n/d exactly as shown
below, identifying the repeating digits in the fractional part of n/d,
if any. Note that n, d and the integer part of n/d are each
right-justified in a field of width 5, the equals sign is surrounded by
exactly one space, the decimal point must be preceded and followed by at
least one digit, and the outputs are separated by a blank line.
You must identify the minimal, leftmost sequence of repeating fractional
digits if the decimal representation does in fact repeat. If the
fractional part is longer than 50 digits and there is no repeating
sequence contained within the first 50 digits, output the first 50 digits
followed by "...".
Note: To identify a repeating sequence of length 50 will require you to calculate 100 fractional digits (to verify the repetition).
Input must be read from the file "prob3.in", and output must be
written to the file "prob3.out". All output to the screen will be
ignored.
<BOF> 27836 462 1315 227 1 252 30003 16 <EOF>
27836 ------
----- = 60.251082
462
1315
----- = 5.79295154185022026431718061674008810572687224669603...
227
1 ------
----- = 0.00396825
252
30003
----- = 1875.1875
16