为什么输入两个数字,只显示一个数字的积(求各位数的积运算)
#include<stdio.h>long fun (long sum)
{
long i;
i=1;
do
{
i*=sum%10;
sum/=10;
}while(sum);
return i;
}
void main()
{ long n;
printf("the num is:");
scanf("%ld\n",&n);
printf("the chengji is:%ld\n",fun(n));
}
2012-04-19 00:14