#include <iostream>
#include <stdio.h>
#include <string.h>
#include <vector>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
#include <set>
using namespace std;
char numToEng[10][10]={"zero","one","two","three","four","five","six","seven","eight","nine"};
int main(){
char str[102];
while(scanf("%s",str)!=EOF){
int sum=0;
int len=strlen(str);
for(int i=0;i<len;i++)
sum+=str[i]-'0';
stack<int> S;
do{
S.push(sum%10);
sum /= 10;
}while(sum);
while(!S.empty()){
if(S.size()>1)
printf("%s ",numToEng[S.top()]);
else
printf("%s",numToEng[S.top()]);
S.pop();
}
}
return 0;
}
1005. Spell It Right (20)
最新推荐文章于 2019-10-09 13:56:35 发布