#P2399. non hates math
non hates math
Description
Given a decimal, convert it into an improper fraction.
There are two types of decimals (we do not consider infinite non-repeating decimals):
- Terminating decimal;
- Repeating decimal (the repeating part is given and enclosed in
()).
Input Format
A decimal number .
Output Format
Output the reduced improper fraction form of the decimal .
1.32
33/25
1.(3)
4/3
1.0
1/1
Hint
The range of the input decimal is to , and the number of characters after the decimal point does not exceed .
For of the testdata, there is no repeating part.
Translated by ChatGPT 5
京公网安备 11011102002149号