Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- czyn=[]
- n=int(input())
- pierw=[0]*(n+2)
- #for i in range(0,2*n):
- #print(i)
- #pierw.append(int(0))
- #print("xd")
- for i in range (2,n+2):
- #print(i)
- if pierw[i]==0:
- k=int(1)
- while i*k<=n:
- if pierw[i*k]!=0:
- pierw[i*k]=min(int(pierw[i*k]),int(i))
- else:
- pierw[i*k]=int(i)
- k+=1
- while n>1:
- print(n,pierw[n])
- czyn.append(pierw[n])
- n//=pierw[n]
- if pierw[n]==0:
- break
- for i in czyn:
- print(i,end='')
- print(";",end='')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement