编程介的小学生 2019-06-29 21:21 采纳率: 20.5%
浏览 303

最接近的分数怎么求解,用的是C语言的程序的编写的设计的代码的过程的计算的方式是什么

Problem Description
Find the fraction closest to sqrt(N), the denominator of the fraction is no more than M.

Input
The input consists of multiple test cases.For each case the input contains two integers N and M, 1<=N<=1000000, 1<=M<=1000.

Output
For each case output one line, contaning the fraction that in the form "A/B" where A and B are positive integers with no common factors greater than one.

Sample Input
9 4

Sample Output
3/1

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 寻一个支付宝扫码远程授权登录的软件助手app
    • ¥15 解riccati方程组
    • ¥15 display:none;样式在嵌套结构中的已设置了display样式的元素上不起作用?
    • ¥30 用arduino开发esp32控制ps2手柄一直报错
    • ¥15 使用rabbitMQ 消息队列作为url源进行多线程爬取时,总有几个url没有处理的问题。
    • ¥15 Ubuntu在安装序列比对软件STAR时出现报错如何解决
    • ¥50 树莓派安卓APK系统签名
    • ¥65 汇编语言除法溢出问题
    • ¥15 Visual Studio问题
    • ¥20 求一个html代码,有偿