我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

用C语言,The nearest fraction

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

近期文章

  • 数据结构C语言二叉树
  • Android Studio 使用自带SQLite数据库还能否连接服务器?
  • 请写出以下程序运行结:
  • 关于maven编译target目录的一个问题
  • Python这段代码哪里出问题?
  • java类属性不能修改
  • 求解决revit2016 安装问题
  • 我碰到这种用户该怎么办?
  • 出现了Attribute Error,请问怎么处理?语言- python
  • 运用C语言的程序这个Stars地实现的模拟
  • excel写一个简单的宏2个单元格互相同步
  • 专科前端实习,有机会吗
  • 为什么java多线程能提升效率
  • mysql安装不成功
  • 关于#派生类#的问题,如何解决?
  • 程序设计的问题,I can do it better,C语言
  • Matlab中永磁同步电机输出的三相电流为什么不是平滑的曲线
  • 想知道这两个不同方法的编写的程序有什么区别和好处
  • h5如何调用支付宝获取登录authcode?
  • 二叉树的顺序存储,存储数组大小

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华