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. <译>Spark Sreaming 编程指南

    Spark Streaming 编程指南 Overview A Quick Example Basic Concepts Linking Initializing StreamingContext D ...

  2. iOS10相册相机闪退bug

    iOS10系统下调用系统相册.相机功能,遇到闪退的情况,描述如下: This app has crashed because it attempted to access privacy-sensit ...

  3. mongodb - Replication Set搭建过程

    1.创建目录 mkdir -p /mongodb/data/r1 mkdir -p /mongodb/data/r2 mkdir -p /mongodb/data/r3 mkdir -p /mongo ...

  4. python打包exe文件-ImportError: No module named 'queue'

    我之前遇到的一个错误就是 File "site-packages\urllib3\packages\six.py", line 92, in __get__ File " ...

  5. ajax实现json循环输出结果

    $.post("bankInfo.php",{key:jee_server,uid:jee_uid},function(data) { var strs=JSON.stringif ...

  6. Asp.net2.0里的SessionPageStatePersister

    备注: ASP.NET 页可在处理和提供任何网页所必需的原本无状态 HTTP 请求与响应之间存储 Page 状态信息.此状态称为“视图状态”. ASP.NET 的默认持久性机制是使用 HiddenFi ...

  7. mysql中实现分类汇总功能

    1.创建测试表: CREATE TABLE test_ROLLUP_1 ( StateCode ), DepCode ), SendMoney INT ); 2.插入测试语句: INSERT INTO ...

  8. nginx-1.2.7+tcp_proxy_module负载均衡配置

    对于安装方面不清楚的,可移步 nginx + tcp_proxy_module的安装 参考nginx_tcp_proxy_module的readme文件,对每个定义项都做了详细的描述,tcp{...} ...

  9. 点滴积累【C#】---C#实现上传照片到物理路径,并且将地址保存到数据库,

    效果: 思路: 首先,获取图片物理地址,然后进行判断将图片保存到文件夹下,再将图片的信息保存到数据库. 数据库: create table image1 ( ID ,) primary key, Im ...

  10. [gj]狮子经典语录