#include<stdio.h>
#include<math.h>
int main()
{
char n[100]={0};
char ret[10][6]={"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
int sum=0, len=0;
int a[4]={0};
scanf("%s", n);
for(int i=0; n[i]; i++){
sum=sum+n[i]-'0';
}
for(len=0; sum>0;len++){
a[len]=sum%10;
sum/=10;
}
len--;
do
{
printf("%s", ret[a[len]]);if(len>0){
printf(" ");
}
len--;
} while (len>=0);
return 0;
}
PTA乙1002
最新推荐文章于 2024-09-02 14:21:30 发布