//1005
char a[105];
char* num[] = {"zero","one","two","three","four","five","six","seven","eight","nine"};
stack<char*> out;
int main(){
while(scanf("%s",a)!=EOF){
int sum=0;
for(int i=0;i<strlen(a);i++){
sum+=a[i]-'0';
}
if(sum==0) out.push(num[sum]);
while(sum){
out.push(num[sum%10]);
sum/=10;
}
while(!out.empty()){
printf("%s",out.top());
out.pop();
if(!out.empty()) printf(" ");
}
printf("\n");
}
return 0;
}
wizardOfCode
发布了66 篇原创文章 · 获赞 4 · 访问量 4120
私信
关注