No.1464 Number Conversion
レベル :
/ AI推定難易度 : 500
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 512 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 212
作問者 :
Kanten4205
/ テスター :
square1001
タグ : / 解いたユーザー数 212
作問者 :
問題文最終更新日: 2022-04-18 21:33:46
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
Problem Statement
Convert $X$ into a fraction.
Input
$X$
In all test cases, $0 \leq X \leq 10^5$ is satisfied.
In the input, $X$ is given with at most $8$ digits after the decimal point. It is also guaranteed that the given number can be represented as a fraction.
Output
When $X$ is written as $\cfrac{S}{B}$ as a fraction that cannot be reduced any further, output it on one line in the format "$S/B$".
Print a newline at the end.
Sample
Sample 1
Input
0.5
Output
1/2
$0.5 = \cfrac{1}{2}$.
Sample 2
Input
10
Output
10/1
An integer may also be given as input.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。