Python
Объяснение:
код:
import random
n = random.randint(10, 100)
t = []
p = []
for i in range(1, n):
if n % i == 0:
i = str(i)
t += i
i = int(i)
for k in range(2, i):
if i % k == 0:
p += i
break
t = list(map(int, t))
p = list(map(int, p))
for x in p:
if x in t:
t.remove(x)
t.remove(1)
if len(t) == 0:
t.append(n)
print(*t)
else:
s = [str(x) for x in t]
print('simple', '(', n, ')', '=', *s)
Python
Объяснение:
код:
import random
n = random.randint(10, 100)
t = []
p = []
for i in range(1, n):
if n % i == 0:
i = str(i)
t += i
i = int(i)
for k in range(2, i):
if i % k == 0:
i = str(i)
p += i
break
t = list(map(int, t))
p = list(map(int, p))
for x in p:
if x in t:
t.remove(x)
t.remove(1)
if len(t) == 0:
t.append(n)
print(*t)
else:
s = [str(x) for x in t]
print('simple', '(', n, ')', '=', *s)
Python
Объяснение:
код:
import random
n = random.randint(10, 100)
t = []
p = []
for i in range(1, n):
if n % i == 0:
i = str(i)
t += i
i = int(i)
for k in range(2, i):
if i % k == 0:
i = str(i)
p += i
break
t = list(map(int, t))
p = list(map(int, p))
for x in p:
if x in t:
t.remove(x)
t.remove(1)
if len(t) == 0:
t.append(n)
print(*t)
else:
s = [str(x) for x in t]
print('simple', '(', n, ')', '=', *s)