作业帮 > 综合 > 作业

从标准输读入一个正整数,把它转为英语单词输出,如读入123,则输出"one two three"

来源:学生作业帮 编辑:拍题作业网作业帮 分类:综合作业 时间:2024/04/29 17:41:38
从标准输读入一个正整数,把它转为英语单词输出,如读入123,则输出"one two three"
求大神给出源程序
#include
#include
void main()
{
char *p[10]={"zero","one","two","three","four","five","six","seven","eight","nine"};
char a[30];
int num;
int i=0,j;
int temp;
int count;
printf("please enter you num:");
scanf("%d",&num);
while(num!=0)
{
a[i++]=num%10;
num=num/10;
}
count=i--;
for(j=count,i=0;j>=i;i++,j--)
{
temp=a[j];
a[j]=a[i];
a[i]=temp;
}
for(i=0;i