英文原题:题目来源:https://acs.jxnu.edu.cn/problem/HDU1926
Give Me an E
1000ms 32768K
描述:
Everyone knows that the letter “E” is the most frequent letter in the English language. In fact, there are one hundred sixteen E’s on this very page ... no, make that one hundred twenty one. Indeed, when spelling out integers it is interesting to see which ones do NOT use the letter “E”. For example 6030 (six thousand thirty) doesn’t. Nor does 4002064 (four million two thousand sixty four).
It turns out that 6030 is the 64th positive integer that does not use an “E” when spelled out and
4002064 is the 838th such number. Your job is to find the n-th such number.
Note: 1,001,001,001,001,001,001,001,001,000 is “one octillion, one septillion, one sextillion, one quintil-lion, one quadrillion, one trillion, one billion, one million, one thousand”. (Whew!)
输入:
The input file will consist of multiple test cases. Each input case will consist of one positive integer n (less than 231) on a line. A 0 indicates end-of-input. (There will be no commas in the input.)
输出:
For each input n you will print, with appropriate commas, the n-th positive integer whose spelling does not use an “E”. You may assume that all answers are less than 10^28.
翻译:
给我一个E
描述:
每个人都知道字母“E”是英语中最常见的字母。事实上,这页上有116个E。。。不,是121个。事实上,在拼写整数时,看看哪些整数不使用字母“E”是很有趣的。例如6030没有。400206也没有。
事实证明,6030是第64个正整数,4002064是第838个这样的数字。你的工作就是找到第n个这样的数字。
注:1001000是用“one octillion, one septillion, one sextillion, one quintil-lion, one quadrillion, one trillion, one billion, one million, one thousand”来表示的。
输入:
输入文件将由多个测试用例组成。每个输入案例将由一行上的一个正整数n(n小于231)组成。0表示输入结束。(输入中将没有逗号)
输出:
对每个输入,将使用适当的逗号打印拼写不使用“E”的第n个正整数。你可以假设所有答案都小于10的28次方。