首页 > 代码库 > P85

P85

#include<stdio.h>
long fun(long num)
{
	long k=1;
	do
	{
		k*=num%10;
		num/=10;
	}
	while(num>0);
	return k;
}
main()
{
	long n;
	printf("please enter a number:");
	scanf("%ld",&n);
	printf("\n%ld\n",fun(n));
}