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 (≤).
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
#include<iostream>//可见不使用c++ #include<string>也可,但一般加上避免错误 using namespace std; int main(){ string str[]={"zero","one","two","three","four","five","six","seven","eight","nine"}; string N; cin>>N; int sum=0; int i=0; for(;i<N.length();i++){ sum+=N[i]-'0'; } string strsum=to_string(sum); for(i=0;i<strsum.length()-1;i++){ cout<<str[strsum[i]-'0']<<" "; } cout<<str[strsum[i]-'0']<<endl; }