请编写函数(或方法)fun,其功能是:计算正整数n的各位上的数字之积,将结果放到c中。
例如,n=256,则c=2×5×6=60;n=50,则c=5×0=0;
其中,n为函数(或方法)fun的输入参数,c为函数(或方法)fun的返回值。
def fun(n):
c=1
while n>0:
c = c*(n%10)
n = n/10
return c
n = int(input())
c = fun(n)
print(c)
def fun(n):
s = 1
for i in str(n):
s *= int(i)
return s
n = int(input(">>>"))
c = fun(n)
print(c)