CodeBus
www.codebus.net
Search
Sign in
Sign up
Hot Search :
Source
embeded
web
remote control
p2p
game
More...
Location :
Home
Search - yy.r
Main Category
SourceCode
Documents
Books
WEB Code
Develop Tools
Other resource
Search - yy.r - List
[
MiddleWare
]
yy
DL : 0
给出一个非负小数,找出分子不超过M,分母不超过N的最简分数或整数, 使其最接近给出的小数。如果这个分数不唯一,输出‘TOO MANY’。 输入文件格式(closest.in) 第一行,M,N(1<=M,N<=10^9) 第二行,即小数R,(0<R 输出文件格式(closest.out) 仅一行,若解唯一输出 分子 / 分母(整数K写成K/1),否则输出TOO MANY 样例输入: 360 120 3.1415926536 样例输出: 355/113-Give a non-negative decimals to identify elements does not exceed M, the denominator does not exceed N most Jane Score or integral to the nearest decimal given. If the scores are not the only, the output TOO MANY. Input file format (closest.in) the first line, M, N (1 <= M, N <= 10 ^ 9) the second line, that is, a small number of R, (0 <R output file format (closest.out) only his party, If the only solution output elements/denominator (integer K written K/1), otherwise the output sample TOO MANY Input: 360 1203.1415 926536 sample output: 355/113
Date
: 2026-01-10
Size
: 6kb
User
:
高旭阳
CodeBus
is one of the largest source code repositories on the Internet!
Contact us :
1999-2046
CodeBus
All Rights Reserved.