https://pintia.cn/problem-sets/994805260223102976/problems
#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
void PINGYIN( char ch[])
{
char cha[][5] ={"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};//创建拼音数组 数组每一行最大长度为5
int len = strlen( ch );
int sum = 0;
for(int i = 0 ; i < len ; i++)
{
sum += ch[i] - '0';
}
int i = 0 , res[5];
while( sum != 0 )
{
res[i++] = sum % 10;
sum /= 10;
}
i--; //不写会段越界。
while(i >= 0 )
{
cout << cha[res[i--]] ;
if(i >= 0) cout << ' ';
}
}
int main()
{
char ch[1000];
cin >> ch; // 不是 ch[0]
PINGYIN( ch );
return 0;
}