05-2. 念数字(15)

#include 

int main()
{
	int a;
	scanf("%d",&a);
	if(a<0){
		printf("fu ");
		a=-a;
	}
	int musk=1;
	int d=a;
	while(d>9) {
		d/=10;
		musk*=10;
	}
	char *s[] = {"ling","yi","er","san","si","wu","liu","qi","ba","jiu"};
	do{
		int t=a/musk;
		printf("%s",s[t]);
		
		if(musk>9)printf(" ");
		 
		a%=musk;
		musk/=10;
	}while(musk>0);
	
	return 0;
}

你可能感兴趣的:(05-2. 念数字(15))