問題一覧 > 通常問題

No.1464 Number Conversion

レベル : / AI推定難易度 : 500 / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / 標準ジャッジ問題
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 212
作問者 : Kanten4205 / テスター : square1001
お気に入りにしたユーザー ProblemId : 4623 / 自分の提出
問題文最終更新日: 2022-04-18 21:33:46
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
yukicoder contest 289 (Kanten4205’s Birthday Contest) (順位表) の他の問題:

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もしくは右上の雲マークをクリックしてアカウントを作成してください。