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#include <stdio.h>2#include <stdlib.h>3#include <algorithm>4#include <string.h>5 using namespacestd;6 Charnum[Ten][Ten]={"Zero"," One"," Both","three"," Four","Five","Six","Seven","Eight","Nine"};7 Chars[111];8 Chardigit[Ten];9 Ten One intMainintargcChar*argv[]) A { - gets (s); - intlen=strlen (s); the intsum=0, numlen=0; - for(intI=0; i<len;i++) - { -sum+= (s[i]-'0'); + } - if(sum==0) + { Aprintf"Zero");return 0; at } - -sprintf (Digit,"%d", sum); - //printf ("%s\n", digit); - //for (int i=0;i<strlen (digit); i++) - //printf ("%c", Digit[i]); in for(intI=0; I<strlen (digit); i++) - { to +printf"%s", num[digit[i]-'0']); - if(I!=strlen (Digit)-1) printf (" "); the } *System"Pause"); $ return 0;Panax Notoginseng}
A1005. Spell It Right (20)