#include<stdio.h>
int main()
{
int m,n;
int i;
int sum=1;
scanf("%d",&m);
if(m<0)
{ m=-m;
printf("fu ");
}
n=m;
while(n>9){
sum=sum*10;
n=n/10; //循环算出高位数字
}
for(;sum>0;)
{
i=m/sum;
switch(i){
case 0:printf("ling");break;
case 1:printf("yi");break;
case 2:printf("er");break;
case 3:printf("san");break;
case 4:printf("si");break;
case 5:printf("wu");break;
case 6:printf("liu");break;
case 7:printf("qi");break;
case 8:printf("ba");break;
default:printf("jiu");break;
}
if(sum>9)printf(" "); //判断最后一位无空格
m=m%sum;
sum=sum/10;
}
return 0;
}
L1-007 念数字 (10 分)
最新推荐文章于 2020-05-01 18:22:20 发布