1 #include<iostream>
2 #include<vector>
3 #include<string>
4 using namespace std;
5
6 int main()
7 {
8 int sum=0,tem;
9 string str;
10 cin>>str;
11 for(unsigned int i=0;i<str.length();i++)
12 {
13 tem=str[i]-\'0\'; //把char型数字转换成对应的int型
14 sum+=tem; //sum<=900
15 }
16 vector<string> v;
17 for(int i=sum;i!=0;i/=10) //9 25 346
18 {
19 switch(i%10)
20 {
21 case 0: v.push_back("ling");break;
22 case 1: v.push_back("yi");break;
23 case 2: v.push_back("er");break;
24 case 3: v.push_back("san");break;
25 case 4: v.push_back("si");break;
26 case 5: v.push_back("wu");break;
27 case 6: v.push_back("liu");break;
28 case 7: v.push_back("qi");break;
29 case 8: v.push_back("ba");break;
30 default: v.push_back("jiu");
31 }
32 }
33 vector<string>::iterator iter;
34 for(iter=v.end()-1;iter!=v.begin();iter--)
35 cout<<*iter<<" ";
36 cout<<*iter;
37 return 0;
38 }