黑洞数 def isHd(n): s=str(n) min1="" max1="" for i in sorted(s): min1+=str(i) for j in sorted(s,reverse=True): max1+=str(j) if int(max1)-int(min1)==n: return True return False