编程介的小学生 2017-06-24 01:58 采纳率: 20.5%
浏览 750
已采纳

Give Me an E

Problem Description
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!)

Input
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.)

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 1028.

Sample Input
1
10
838
0

Sample Output
2
44
4,002,064

  • 写回答

1条回答 默认 最新

  • threenewbee 2017-07-21 12:22
    关注
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 求数据集和代码#有偿答复
  • ¥15 关于下拉菜单选项关联的问题
  • ¥20 java-OJ-健康体检
  • ¥15 rs485的上拉下拉,不会对a-b<-200mv有影响吗,就是接受时,对判断逻辑0有影响吗
  • ¥15 使用phpstudy在云服务器上搭建个人网站
  • ¥15 应该如何判断含间隙的曲柄摇杆机构,轴与轴承是否发生了碰撞?
  • ¥15 vue3+express部署到nginx
  • ¥20 搭建pt1000三线制高精度测温电路
  • ¥15 使用Jdk8自带的算法,和Jdk11自带的加密结果会一样吗,不一样的话有什么解决方案,Jdk不能升级的情况
  • ¥15 画两个图 python或R