Given a non-negative integer n, your task is to compute the sum of the digits of N, and output every digit of the sum In 中文版.
Input Specification:
Each input file contains the one test case. Each case occupies one line which contains an N (<= 10100).
Output Specification:
For all test case, output in one line the digits of the sum in 中文版 words. There must be one space between-consecutive words, but no extra space at the end of a line.
Sample Input:
12345
Sample Output:
One five
1 ImportJava.util.*;2 Public classMain {3 Private StaticMap<character,string> dig2eng=NewHashmap<character,string>();4 Static {5Dig2eng.put (' 0 ', "zero");6Dig2eng.put (' 1 ', "one");7Dig2eng.put (' 2 ', "both");8Dig2eng.put (' 3 ', "three");9Dig2eng.put (' 4 ', "four");TenDig2eng.put (' 5 ', "five"); OneDig2eng.put (' 6 ', "six"); ADig2eng.put (' 7 ', "seven"); -Dig2eng.put (' 8 ', "eight"); -Dig2eng.put (' 9 ', "nine"); the } - Public Static voidMain (string[] args) { -Scanner in =NewScanner (system.in); -String n=In.next (); + intSum=0; - for(intI=0;i<n.length (); i++){ +Sum+=n.charat (i)-' 0 '; A } atString str=string.valueof (sum); -StringBuilder sb=NewStringBuilder (); - for(intI=0;i<str.length (); i++){ -Sb.append (Dig2eng.get (Str.charat (i) + "")); - } -Sb.deletecharat (Sb.length ()-1); in System.out.println (sb.tostring ()); - } to}
1005. Spell It Right (20)