分解质因数
例如:输入6,输出 2*3=6
def prime_factor(): n = int(input()) old_n = n nums = [] while n > 1: for i in range(2, n+1): if n % i == 0: n //= i nums.append(str(i)) break res = '*'.join(nums) + '=' + str(old_n) print(res)