#B. 循环小数节

    Type: Default 1000ms 256MiB

循环小数节

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

   写一个程序,输入一个形如N/D的分数(N是分子,D是分母),输出它的小数形式。如果小数有循环节的话,把循环节放在一个对括号中,例如:
   1/3=0.33333333  写成0.(3)
   41/333=0.123123123 写成0.(123)
   用xxx.0表示整数
   典型的转化例子:
   1/3=0.(3)
   22/5=4.4
   22/5=4.4
   2/2=1.0
   3/8=0.375
   45/56=0.803(571428)

输入格式

    单独的一行包括被空格分开的N和D,1<=N,D<=100000。

输出格式

  输出一行小数的表示方法上面已经说得很明白了。

样例

45 56
0.803(571428)

提示

【输出提示】能够整除最后一行无换行,有循环节最后输出后换行

竞赛班——模拟算法(一)

Not Attended
Status
Done
Rule
IOI
Problem
5
Start at
2024-11-9 9:30
End at
2024-11-14 9:30
Duration
120 hour(s)
Host
Partic.
8