#45162: python我的解答


wangyupeng714@gmail.com (yp w)

學校 : 不指定學校
編號 : 293465
來源 : []
最後登入時間 :
2024-11-17 19:04:24
a010. 因數分解 | From: [122.100.179.129] | 發表日期 : 2025-01-18 18:12

a=int(input())
ans=''
i=2
while a!=1:
j=0
while a%i==0:
j+=1
if j==1:
ans+= " * "+str(i)
a=a/i
if j>1:
ans+= "^"+str(j)
j=0
i+=1
print(ans[3:])
 
ZeroJudge Forum