2018.4.12
// 一开始就考虑了输入为0的情况,之后去掉后发现测试点2就是这种情况
#include <iostream>
#include <vector>
using namespace std;
vector<string> ans;
string str[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" };
int main(){
char ch;
long long num = 0;
while(1){
ch = getchar();
if(ch > '9' || ch < '0')
break;
num += ch - '0';
}
// 输入为0的情况
if(num == 0)
ans.push_back("zero");
int last;
while(num){
last = num % 10;
ans.push_back(str[last]);
num /= 10;
}
vector<string>::reverse_iterator rit;
for(rit = ans.rbegin(); rit != ans.rend(); rit++){
if(rit != ans.rbegin())
cout << ' ';
cout << *rit;
}
cout << endl;
return 0;
}