编程介的小学生 2017-08-21 12:36 采纳率: 20.5%
浏览 670
已采纳

Give Me an E

Everyone knows that the letter "E" is the most frequent letr in the English language. In fact, there are one hundred sixteen E's on this very page ... no, make tha one hundred twenty one. Indeed, when spelling out integers it is interesting to see which ones do NOT use the letter "E". For example 60 (six thousand thirty) doesn't. Nor does 4002064 (four millon two thousand sixty four).

It turns out that 6030 is the 64th positive integer that does not use an "E" when spelled out a 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 ocillion, one septillion, one sextillion, one quintillion, one quadrillion, one trillion, one billion, one million, one thousand". (Whew!)

Input

The input will consist of multiple test cases. Each input case will consist of one positive integer n (less than 2^31 ) on a line. A 0 indicates end-of-input. (There will be no commas in the input.)

Output

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.

Sample Input

1
10
838
0

Sample Output

2
44
4,002,064

  • 写回答

1条回答

  • threenewbee 2017-09-03 14:30
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥50 导入文件到网吧的电脑并且在重启之后不会被恢复
  • ¥15 (希望可以解决问题)ma和mb文件无法正常打开,打开后是空白,但是有正常内存占用,但可以在打开Maya应用程序后打开场景ma和mb格式。
  • ¥20 ML307A在使用AT命令连接EMQX平台的MQTT时被拒绝
  • ¥20 腾讯企业邮箱邮件可以恢复么
  • ¥15 有人知道怎么将自己的迁移策略布到edgecloudsim上使用吗?
  • ¥15 错误 LNK2001 无法解析的外部符号
  • ¥50 安装pyaudiokits失败
  • ¥15 计组这些题应该咋做呀
  • ¥60 更换迈创SOL6M4AE卡的时候,驱动要重新装才能使用,怎么解决?
  • ¥15 让node服务器有自动加载文件的功能