Product of Digits
具体题目请点击我查看``
n=int(input())
A=[]
s=0
if(n==0):
print(10)
else:
while(n>=10):
f=0
for i in range(2,10):
if(n%(11-i)==0):
n=int(n/(11-i))
A.append((11-i))
f=1
break
if(f==0):
print(-1)
s=1
break
A.append(n)
A.sort()
l=0
if(s==0):
for i in range(len(A)):
l=A[i]*(10**(len(A)-i-1))+l
print(l)
这道题比较奇葩的是0对应的是10。
注意循环要从9开始到2 !