This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
n = int(input()) | |
i = 2 | |
while n != 1: | |
if n % i == 0: | |
print(i) | |
n //= i | |
else: | |
i += 1 |
'코딩테스트 준비' 카테고리의 다른 글
백준 1929번 소수 구하기 (0) | 2021.02.17 |
---|---|
백준 2581 소수 (0) | 2021.02.16 |
메모이제이션을 사용한 백준 2775번 (0) | 2021.02.16 |
유클리드 호제법 - 최대공약수 구하는 알고리즘, 최소공배수 (0) | 2021.02.16 |
이진 탐색, 이진 탐색 트리. (0) | 2021.02.14 |