程序不出结果,各位帮忙看下
将任意整数n的各位数转换成英文单词,写的程序如下,可是输入n之后不出结果,请各位帮忙看下,谢谢#include<stdio.h>
#include<math.h>
void main()
{
long p,m,n,num;
printf("input the number:");
scanf("%ld\n",&n);
if(n<1) return;
m=n;
num=0;
while(m!=0)
{m/=10;
num++;
}
for( ;num>0;num--)
{m=(int)pow(10,num-1);
p=n/m;
switch(p)
{
case 0:
printf("zero");
break;
case 1:
printf("one");
break;
case 2:
printf("two");
break;
case 3:
printf("three");
break;
case 4:
printf("four");
break;
case 5:
printf("five");
break;
case 6:
printf("six");
break;
case 7:
printf("seven");
break;
case 8:
printf("eight");
break;
case 9:
printf("ten");
break;
}
n%=m;
}
}