Advertisement
Egor_1425

Untitled

Jul 13th, 2024
16
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. def Factor(n):
  2.     Ans = []
  3.     d = 2
  4.     while d * d <= n:
  5.         if n % d == 0:
  6.             Ans.append(str(d))
  7.             n //= d
  8.         else:
  9.             d += 1
  10.     if n > 1:
  11.         Ans.append(str(n))
  12.     return Ans
  13.  
  14. n = int(input())
  15. print('*'.join(Factor(n)))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement