#46528: Python ?!


webeason1126@gmail.com (張育菘)

學校 : 不指定學校
編號 : 310002
來源 : [61.216.143.245]
最後登入時間 :
2025-08-26 20:42:56

def 因數分解(n):
    result = []
    for i in range(2, int(n ** 0.5) + 1):
        count = 0
        while n % i == 0:
            n //= i
            count += 1
        if count > 0:
            if count == 1:
                result.append(str(i))
            else:
                result.append(f"{i}^{count}")
    if n > 1:
        result.append(str(n))
    return " * ".join(result)

n = int(input())
print(因數分解(n))