알고리즘 문제 풀기/Codeup
Codeup 1284 - 암호 해독
bug_maker
2019. 2. 9. 09:33
http://codeup.kr/problem.php?id=1284
Codeup 1284 - 암호 해독
import math
n = int(input())
a = []
index = 0
sq = int(math.sqrt(float(n)))
for i in range(0, 30):
a.append(0)
for i in range(2, sq+1):
while n % i == 0:
n /= i
a[index] = i
index += 1
if n != 1:
a[index] = n
index += 1
if index == 2:
print(int(a[0]), int(a[1]))
else:
print('wrong number')