YT14-HDU-求1/n的第m位数
来源:互联网 发布:算法第四版 kindle 编辑:程序博客网 时间:2024/05/18 16:14
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 25 7123 123
Sample Output
508
Author
Source
HDU 2007-10 Programming Contest_WarmUp
代码如下:
#include <iostream>using namespace std;int main(){ int n,m,i,s,t; while(cin>>n>>m) { if(m==1) cout<<0<<endl; else { s=10; for(i=1; i<=m; i++) { t=s/n; s=s%n*10; } cout<<t<<endl; } } return 0;}
1 0
- YT14-HDU-求1/n的第m位数
- YT14-HDU-求N^N的个位数(暴力破解版)
- 给定数m,求由n位数的组成m的数列(m>=n>0)
- 求N!的位数
- 求N!的位数
- 求N!的位数
- 求1-n位数的所有数
- 求 Fibonacci 数第n位的位数 ~高精度
- Just a Numble(求小数的第N位数)
- hdu 1018 -Big Number(求n的阶乘的位数)
- HDU 1018 Big Number(求n!的位数)
- Hdu 1018 Big Number 求N!的位数
- HDU 1018 Big Number(求n!的位数)
- hdu 1018 Big Number_Stirling数求N!的位数
- hdu 1018 big number (求N!的位数)
- (hdu step 2.3.3)Big Number(求N!的位数)
- YT14-HDU-三分查找求F(x)的最小值
- 求大数n!的位数
- windowSoftInputMode 各个值得含义
- jdbc批处理
- 翻译经典之《Cisco Lan Switching》第六章 理解生成树(五):生成树初始化收敛三部曲
- CF 245H Queries for Number of Palindromes
- 在源代码中的空格及列表问题
- YT14-HDU-求1/n的第m位数
- spring集成memcached示例二
- Leetcode-- Sort Colors
- 黑苹果恢复方法。
- 英雄会在线编程题目(请大家不吝赐教)
- spring集成memcached示例一
- JavaScript中的标签语句
- Android 应用实现多进程
- 非SPJ的优化