将浮点数转化成分数

it2023-06-03  82

from fractions import Fraction a=float(input()) print(Fraction(value).limit_denominator())

输入一个小数,转化成一个分数

最新回复(0)