промежутое
This commit is contained in:
17
programm5.py
Normal file
17
programm5.py
Normal file
@@ -0,0 +1,17 @@
|
||||
with open('INPUT.TXT', 'r') as f:
|
||||
n = int(f.read().strip())
|
||||
|
||||
factors = []
|
||||
|
||||
d = 2
|
||||
while d * d <= n:
|
||||
while n % d == 0:
|
||||
factors.append(d)
|
||||
n //= d
|
||||
d += 1
|
||||
|
||||
if n > 1:
|
||||
factors.append(n)
|
||||
|
||||
with open('OUTPUT.TXT', 'w') as f:
|
||||
f.write('*'.join(map(str, factors)))
|
||||
Reference in New Issue
Block a user