#include <bits/stdc++.h>
using namespace std;
const int N=100007;
string k[11]={"zero","one","two","three","four","five","six","seven","eight","nine"};
int a[N];
int main(){
string s;
int ans=0,c=0;
getline(cin,s);
for(int i=0;i<s.size();i++){
int x=s[i]-'0';
ans+=x;
}
//如果最后总值为0,那么直接输出zero就可以结束了
if(ans==0){
cout<<k[0];
return 0;
}
while(ans){
a[++c]=ans%10;
ans/=10;
}
for(int i=c;i>=1;i--){
if(i!=c)cout<<" ";
cout<<k[a[i]];
}
return 0;
}
PAT甲级1005 Spell It Right
于 2023-02-08 12:00:16 首次发布