Just a Numble

Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2107    Accepted Submission(s): 987

Problem Description
Now give you two integers n m, you just tell me the m-th number after radix point in 1/n,for example n=4,the first numble after point is 2,the second is 5,and all 0 followed
 
Input
Each line of input will contain a pair of integers for n and m(1<=n<=10^7,1<=m<=10^5)
 
Output
For each line of input, your program should print a numble on a line,according to the above rules
 
Sample Input
4 2
5 7
123 123
 
Sample Output
5
0
8
 
Author
YBB
 
Source
 
Recommend
威士忌   |   We have carefully selected several similar problems for you:  2114 2115 2116 2113 2119 
 

 
  水题,但也要动动脑子。
  模拟除法的运算。输入两个数n和m,求出1/n的小数点后的第m位数。
  代码:
 #include <iostream>

 using namespace std;
int main()
{
int n,m;
while(cin>>n>>m){
if(n==){
cout<<<<endl;
continue;
}
int num = ;
int d = ;
int dn = ;
while(d!=m){
dn = num/n;
num = num%n;
num*=;
++d;
}
cout<<dn<<endl;
}
return ;
}

Freecode : www.cnblogs.com/yym2013

hdu 2117:Just a Numble(水题,模拟除法运算)的更多相关文章

  1. HDU 5578 Friendship of Frog 水题

    Friendship of Frog Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  2. HDU 5590 ZYB's Biology 水题

    ZYB's Biology Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.php?pid ...

  3. HDU 5538 L - House Building 水题

    L - House Building Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://acm.hdu.edu.cn/showproblem.ph ...

  4. hdu 1005:Number Sequence(水题)

    Number Sequence Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)T ...

  5. hdu 1018:Big Number(水题)

    Big Number Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total ...

  6. hdu 2041:超级楼梯(水题,递归)

    超级楼梯 Time Limit: / MS (Java/Others) Memory Limit: / K (Java/Others) Total Submission(s): Accepted Su ...

  7. HDOJ/HDU 1328 IBM Minus One(水题一个,试试手)

    Problem Description You may have heard of the book '2001 - A Space Odyssey' by Arthur C. Clarke, or ...

  8. HDOJ(HDU) 2090 算菜价(简单水题、)

    Problem Description 妈妈每天都要出去买菜,但是回来后,兜里的钱也懒得数一数,到底花了多少钱真是一笔糊涂帐.现在好了,作为好儿子(女儿)的你可以给她用程序算一下了,呵呵. Input ...

  9. HDOJ(HDU) 1555 How many days?(水题)

    Problem Description 8600的手机每天消费1元,每消费K元就可以获赠1元,一开始8600有M元,问最多可以用多少天? Input 输入包括多个测试实例.每个测试实例包括2个整数M, ...

随机推荐

  1. 算法笔记_102:蓝桥杯练习 算法提高 快乐司机(Java)

    目录 1问题描述 2 解决方案   1 问题描述 问题描述 "嘟嘟嘟嘟嘟嘟 喇叭响 我是汽车小司机 我是小司机 我为祖国运输忙 运输忙" 这是儿歌“快乐的小司机”.话说现在当司机光 ...

  2. vConsole

    说明 由于移动端项目在手机中调试时不能使用chrome的控制台,而vconsole是对pc端console的改写 使用方法 使用 npm 安装: npm install vconsole 使用webp ...

  3. highcharts 坐标轴 数值 格式化

    以Y轴为示例: yAxis: { min: 0, gridLineColor: '#ececee', gridLineWidth: 1, lineColor: '#ececee', lineWidth ...

  4. openerp 6.0.2库存业务

    一.复式库存(Double-Entry Stock Management)和库存移动(Stock Move) OpenERP的库存管理采取了独特的复式库存(Double-Entry Stock Man ...

  5. 尚学堂 hadoop

    mr spark storm 都是分布式计算框架,他们之间不是谁替换谁的问题,是谁适合做什么的问题. mr特点,移动计算,而不移动数据. 把我们的计算程序下发到不同的机器上面运行,但是不移动数据. 每 ...

  6. Android实现小圆点显示未读功能

    代码地址如下:http://www.demodashi.com/demo/13541.html 前言 以前我们实现这个功能都是用 BadgeView.java,大体就是将这个java类复制到自己的项目 ...

  7. lsb_release: command not found 解决

    问题:lsb_release 是查看系统版本信息的工具 [root@localhost ~]# lsb_release -a-bash: lsb_release: command not found ...

  8. 判断Server Manager里面的Role是否已经安排

    用InstallState来判断 function Check-DataDeduplication{ Import-Module "ServerManager" -ErrorAct ...

  9. POJ 1258:Agri-Net(最小生成树&amp;&amp;prim)

    Agri-Net Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 38918   Accepted: 15751 Descri ...

  10. iOS9 3DTouch、ShortcutItem、Peek And Pop技术一览

    [iOS]iOS9 3DTouch.ShortcutItem.Peek And Pop技术一览   3DTouch UITouch类里API的变化 iOS9中添加的属性 altitudeAngle 当 ...