求问这题该怎么改
读入一个自然数n,计算其各位数字之和,并用英文输出和的每一位数字。 要求:英文之间以空格隔开。
例如输入: 89563524,则有:8+9+5+6+3+5+2+4=42
则屏幕上输出:four two
#include<stdio.h>
int main()
{
int n,sum=0;
printf("请输入一个整数");
scanf("%d",&n);
while (n)
{
sum=sum+n%10;
n/=10;
}
printf("%d",sum);
}
int numadd(int x)
{
const char *str[]={"zero","one","two","three","four","five","six","seven","eight","nine"};
while('\\n'!=(x=getchar()))
{
printf("%s ",str[x-'0']);
}
return 0;
}