当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

1099:Lottery

题目描述
Eddy's company publishes a kind of lottery.This set of lottery which are numbered 1 to n, and a set of one of each is required for a prize .With one number per lottery, how many lottery on average are required to make a complete set of n coupons?
输入解释
Input consists of a sequence of lines each containing a single positive integer n, 1<=n<=22, giving the size of the set of coupons.
输出解释
For each input line, output the average number of lottery required to collect the complete set of n coupons. If the answer is an integer number, output the number. If the answer is not integer, then output the integer part of the answer followed by a space and then by the proper fraction in the format shown below. The fractional part should be irreducible. There should be no trailing spaces in any line of ouput.
输入样例
2
5
17
输出样例
3 
   5
11 --
   12
   340463
58 ------
   720720
来自杭电HDUOJ的附加信息
Author eddy
Recommend JGShining

该题目是Virtual Judge题目,来自 杭电HDUOJ

源链接: HDU-1099

最后修改于 2020-10-25T22:42:09+00:00 由爬虫自动更新

共提交 88

通过率 45.45%
时间上限 内存上限
2000/1000MS(Java/Others) 65536/32768K(Java/Others)