博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
1005. Spell It Right (20)
阅读量:5766 次
发布时间:2019-06-18

本文共 1219 字,大约阅读时间需要 4 分钟。

Given a non-negative integer N, your task is to compute the sum of all the digits of N, and output every digit of the sum in English.

Input Specification:

Each input file contains one test case. Each case occupies one line which contains an N (<= 10100).

Output Specification:

For each test case, output in one line the digits of the sum in English words. There must be one space between two consecutive words, but no extra space at the end of a line.

Sample Input:

12345

Sample Output:

one five

 

 

1 import java.util.*; 2 public class Main { 3     private static Map
dig2Eng=new HashMap
(); 4 static { 5 dig2Eng.put('0',"zero"); 6 dig2Eng.put('1',"one"); 7 dig2Eng.put('2',"two"); 8 dig2Eng.put('3',"three"); 9 dig2Eng.put('4',"four");10 dig2Eng.put('5',"five");11 dig2Eng.put('6',"six");12 dig2Eng.put('7',"seven");13 dig2Eng.put('8',"eight");14 dig2Eng.put('9',"nine");15 }16 public static void main(String[] args) {17 Scanner in = new Scanner(System.in);18 String N=in.next();19 int sum=0;20 for(int i=0;i

 

转载于:https://www.cnblogs.com/BJUT-2010/p/5568174.html

你可能感兴趣的文章
Andriod Studio Gradle 学习记录
查看>>
我的友情链接
查看>>
How to Configure a Relay Connector for Exchange Server 2010
查看>>
投资扩张不顺利,让京东深感乏力,下一步并购扩张?
查看>>
Kylin, Mondrian, Saiku系统的整合
查看>>
服务器Cacti部署监控系统
查看>>
Canvas之使用图片
查看>>
nginx+PHP+memcached+MySQL+ip-hash做memcached集群
查看>>
LAMP+Postfix+dovecot+extmail
查看>>
PHP中如何防止SQL注入
查看>>
Exchange owa访问出现:邮箱似乎不可用,请稍后访问的错误
查看>>
Windows7 是如何智能判断网络的连通性
查看>>
linux查看磁盘空间大小命令
查看>>
PHP出现 session_start()相关问题
查看>>
用puppet管理网络设备
查看>>
mysqldump与innobackupex备份过程你知多少(二)
查看>>
VMware与宿敌Amazon一笑泯恩仇:重新定义混合云?
查看>>
Hyper-V虚拟化测试19群集虚拟机实时迁移(手动)
查看>>
RedHat 6.1 网卡绑定
查看>>
php分页
查看>>