1005 Spell It Right (20 分)
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
题意:
逐位求和,输出各位的拼音
an={"1":"one","2":"two","3":"three","4":"four","5":"five","6":"six","7":"seven","8":"eight","9":"nine","0":"zero"}
num=input()
sum=0
cnt=0
for i in num:
sum+=int(i)
for i in str(sum):
cnt=cnt+1
print(an[i],end="")
if(cnt!=len(str(sum))):
print(" ",end="")