1 #include<string.h> 2 #include<stdio.h> 3 #include<malloc.h> 4 5 char n[120]; 6 char a[10][5]={"ling","yi","er","san","si","wu","liu","qi","ba","jiu"}; 7 char *p[10]; 8 int main() 9 { 10 scanf("%s",n); //大数转换成字符串处理 11 int len=strlen(n), sum=0; 12 13 for(int i=0;i<len;i++) 14 sum+=((int)n[i]-48); 15 16 int j,k=0; 17 if(sum==0){ 18 printf("ling"); 19 return 0; 20 } 21 22 while(sum!=0){ 23 j=sum%10; 24 for(int i=0;i<10;i++){ 25 if(j==i){ 26 p[k++]=a[i]; 27 break; 28 } 29 } 30 sum=sum/10; 31 } 32 33 for(int i=k-1;i>0;i--) 34 printf("%s ",p[i]); 35 36 printf("%s",p[0]); 37 38 return 0; 39 }