PAT-Advanced-1005. Spell It Right

补充重写版


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:

Sample Output:


实际为PAT-Basic-1002的英文版,改拼音为单词就okay了,20秒即可AC……

然而这么长长的一串switch和case真的是太难看了……所以顺手又写了一遍简单的版本

代码如下:

重写版

发表评论

电子邮件地址不会被公开。 必填项已用*标注