读入一个正整数 n,计算其各位数字之和,用汉语拼音写出和的每一位数字。
AC代码
i = input()
count = 0
for j in i:
count = count + int(j)
d = {"0":"ling","1":"yi","2":"er","3":"san","4":"si","5":"wu","6":"liu","7":"qi","8":"ba","9":"jiu"}
for k in str(count):
if k == str(count)[0]:
print(d[k], end = "")
else:
print(" " + d[k], end = "")